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

git version control git at videolan.org
Wed Jun 10 18:44:23 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 10 18:37:23 2009 +0200| [25609a2c8d3255c637d986cb80507d3ddc2fcaf4] | 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.
(cherry picked from commit d83b24eabeac5bbe5b0b95c55cbc5e77fdd539a9)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 7c8bda7..aea5a4f 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 4b43d56..2ca02f1 100644
--- a/modules/gui/qt4/components/controller.hpp
+++ b/modules/gui/qt4/components/controller.hpp
@@ -204,23 +204,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
@@ -271,10 +262,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