[vlc-devel] commit: Qt: FSC - remove the WIN32 special mode. (Jean-Baptiste Kempf )

git version control git at videolan.org
Wed Jun 10 18:40:21 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 10 18:37:23 2009 +0200| [d83b24eabeac5bbe5b0b95c55cbc5e77fdd539a9] | committer: Jean-Baptiste Kempf 

Qt: FSC - remove the WIN32 special mode.

This makes Windows use the same mode with transparency than on Linux.
This removes the opacity trick to hide() the code.
This fix a few issues that were happening and difficult to fix because of this difficulty.

It will probably break stuffs for people on OLD windows version (2000,XP) with broken graphic cards... (Deactivate it by yourself) But I have spent enough time on this code.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d83b24eabeac5bbe5b0b95c55cbc5e77fdd539a9
---

 modules/gui/qt4/components/controller.cpp |   36 +----------------------------
 modules/gui/qt4/components/controller.hpp |   17 +------------
 2 files changed, 3 insertions(+), 50 deletions(-)

diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index e72cb91..5ee5d63 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -706,13 +706,6 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i )
 
     adjustSize ();  /* need to get real width and height for moving */
 
-#ifdef WIN32TRICK
-    setWindowOpacity( 0.0 );
-    b_fscHidden = true;
-    adjustSize();
-    show();
-#endif
-
     vlc_mutex_init_recursive( &lock );
 
     CONNECT( THEMIM->getIM(), voutListChanged( vout_thread_t **, int ),
@@ -765,18 +758,8 @@ void FullscreenControllerWidget::showFSC()
     {
         centerFSC( number );
     }
-#ifdef WIN32TRICK
-    // after quiting and going to fs, we need to call show()
-    if( isHidden() )
-        show();
-    if( b_fscHidden )
-    {
-        b_fscHidden = false;
-        setWindowOpacity( 1.0 );
-    }
-#else
+
     show();
-#endif
 
 #if HAVE_TRANSPARENCY
     setWindowOpacity( DEFAULT_OPACITY );
@@ -790,12 +773,7 @@ void FullscreenControllerWidget::showFSC()
  */
 void FullscreenControllerWidget::hideFSC()
 {
-#ifdef WIN32TRICK
-    b_fscHidden = true;
-    setWindowOpacity( 0.0 );    // simulate hidding
-#else
     hide();
-#endif
 }
 
 /**
@@ -835,11 +813,7 @@ void FullscreenControllerWidget::slowHideFSC()
     }
     else
     {
-#ifdef WIN32TRICK
-         if ( windowOpacity() > 0.0 && !b_fscHidden )
-#else
          if ( windowOpacity() > 0.0 )
-#endif
          {
              /* we should use 0.01 because of 100 pieces ^^^
                 but than it cannt be done in time */
@@ -868,11 +842,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
             vlc_mutex_unlock( &lock );
             if( b_fs )
             {
-#ifdef WIN32TRICK
-                if( b_fscHidden )
-#else
                 if( isHidden() )
-#endif
                 {
                     p_hideTimer->stop();
                     showFSC();
@@ -886,11 +856,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
             b_fs = b_fullscreen;
             vlc_mutex_unlock( &lock );
 
-#ifdef WIN32TRICK
-            if( b_fs && b_fscHidden )
-#else
             if( b_fs && !isVisible() )
-#endif
                 showFSC();
             break;
         case FullscreenControlHide_Type:
diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp
index 42a6e64..45f42c8 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -206,23 +206,14 @@ signals:
     void advancedControlsToggled( bool );
 };
 
-/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
-   done by trick with setting the opacity of window */
-#ifdef WIN32
-    #define WIN32TRICK
-#endif
 
 /* to trying transparency with fullscreen controller on windows enable that */
 /* it can be enabled on-non windows systems,
    but it will be transparent only with composite manager */
-#ifndef WIN32
-    #define HAVE_TRANSPARENCY 1
-#else
-    #define HAVE_TRANSPARENCY 0
-#endif
+#define HAVE_TRANSPARENCY 1
 
 /* Default value of opacity for FS controller */
-#define DEFAULT_OPACITY 0.75
+#define DEFAULT_OPACITY 0.70
 
 /***********************************
  * Fullscreen controller
@@ -273,10 +264,6 @@ private:
     int i_screennumber;
     QRect screenRes;
 
-#ifdef WIN32TRICK
-    bool b_fscHidden;
-#endif
-
     /* List of vouts currently tracked */
     QList<vout_thread_t *> vout;
 




More information about the vlc-devel mailing list