Commit e17bf628 authored by Laurent Aimar's avatar Laurent Aimar

Fixed fullscreen controler race conditions and ugly static variables.

It is disabled by default, look for the two lines with
	//XXX uncomment for fullscreen controler
to enable it. Please report success/failure in order to enable it by
default (linux/win32).
parent ae059a3c
...@@ -236,13 +236,6 @@ signals: ...@@ -236,13 +236,6 @@ signals:
/*********************************** /***********************************
* Fullscreen controller * Fullscreen controller
***********************************/ ***********************************/
static int showFullscreenControllCallback(vlc_object_t *vlc_object, const char *variable, vlc_value_t old_val,
vlc_value_t new_val, void *data);
static int regMouseMoveCallback(vlc_object_t *vlc_object, const char *variable, vlc_value_t old_val,
vlc_value_t new_val, void *data);
class FullscreenControllerWidget : public ControlsWidget class FullscreenControllerWidget : public ControlsWidget
{ {
Q_OBJECT Q_OBJECT
...@@ -250,14 +243,10 @@ public: ...@@ -250,14 +243,10 @@ public:
FullscreenControllerWidget( intf_thread_t *, MainInterface*, bool, bool ); FullscreenControllerWidget( intf_thread_t *, MainInterface*, bool, bool );
virtual ~FullscreenControllerWidget(); virtual ~FullscreenControllerWidget();
void setHideTimeout( int hideTimeout ) { i_hideTimeout = hideTimeout; } /* */
void setIsFullscreen( bool isFS ) { b_isFullscreen = isFS; } void attachVout( vout_thread_t *p_vout );
void regFullscreenCallback( vout_thread_t *p_vout ); void detachVout( vout_thread_t *p_vout );
void fullscreenChanged( vout_thread_t *, bool b_fs, int i_timeout );
bool isFSCHidden();
public slots:
void unregFullscreenCallback();
protected: protected:
friend class MainInterface; friend class MainInterface;
...@@ -270,27 +259,37 @@ protected: ...@@ -270,27 +259,37 @@ protected:
virtual void keyPressEvent( QKeyEvent *event ); virtual void keyPressEvent( QKeyEvent *event );
private slots: private slots:
void hideFSControllerWidget(); void showFSC();
void planHideFSC();
void hideFSC();
void slowHideFSC(); void slowHideFSC();
private: private:
QTimer *p_hideTimer; QTimer *p_hideTimer;
#if HAVE_TRANSPARENCY #if HAVE_TRANSPARENCY
QTimer *p_slowHideTimer; QTimer *p_slowHideTimer;
#endif #endif
int i_lastPosX; int i_mouse_last_x;
int i_lastPosY; int i_mouse_last_y;
int i_hideTimeout; /* FSC hiding timeout, same as mouse hiding timeout */
bool b_mouseIsOver; bool b_mouse_over;
bool b_isFullscreen;
bool b_slow_hide_begin;
int i_slow_hide_timeout;
#ifdef WIN32TRICK #ifdef WIN32TRICK
bool fscHidden; bool fscHidden;
#endif #endif
virtual void customEvent( QEvent *event ); virtual void customEvent( QEvent *event );
/* Shared variable between FSC and VLC (protected by a lock) */
vlc_mutex_t lock;
bool b_fullscreen;
int i_hide_timeout; /* FSC hiding timeout, same as mouse hiding timeout */
}; };
......
...@@ -99,7 +99,6 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -99,7 +99,6 @@ void InputManager::setInput( input_thread_t *_p_input )
p_input = NULL; p_input = NULL;
i_input_id = 0; i_input_id = 0;
emit rateChanged( INPUT_RATE_DEFAULT ); emit rateChanged( INPUT_RATE_DEFAULT );
emit inputUnset();
} }
} }
......
...@@ -119,8 +119,6 @@ signals: ...@@ -119,8 +119,6 @@ signals:
/// Play/pause status /// Play/pause status
void statusChanged( int ); void statusChanged( int );
void artChanged( QString ); void artChanged( QString );
/// Controll of fullscreen controller
void inputUnset();
/// Teletext /// Teletext
void teletextEnabled( bool ); void teletextEnabled( bool );
void toggleTelexButtons(); void toggleTelexButtons();
......
...@@ -228,10 +228,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -228,10 +228,6 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
CONNECT( fullscreenControls, advancedControlsToggled( bool ), CONNECT( fullscreenControls, advancedControlsToggled( bool ),
this, doComponentsUpdate() ); this, doComponentsUpdate() );
CONNECT( THEMIM->getIM(), inputUnset(),
fullscreenControls, unregFullscreenCallback() );
/* Size and placement of interface */ /* Size and placement of interface */
QVLCTools::restoreWidgetPosition(settings,this,QSize(350,60)); QVLCTools::restoreWidgetPosition(settings,this,QSize(350,60));
...@@ -682,12 +678,17 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x, ...@@ -682,12 +678,17 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
// emit askVideoToResize( *pi_width, *pi_height ); // emit askVideoToResize( *pi_width, *pi_height );
emit askUpdate(); emit askUpdate();
//XXX uncomment for fullscreen controler
//fullscreenControls->attachVout( p_nvout );
} }
return ret; return ret;
} }
void MainInterface::releaseVideo( vout_thread_t *p_vout, void *p_win ) void MainInterface::releaseVideo( vout_thread_t *p_vout, void *p_win )
{ {
//XXX uncomment for fullscreen controler
//fullscreenControls->detachVout( p_vout );
emit askReleaseVideo( p_win ); emit askReleaseVideo( p_win );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment