[vlc-devel] commit: Qt4: systray hides the interface when it is visible regardless of focus ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 10 15:17:16 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 10 16:11:54 2009 +0200| [96db483a5001f0857afaa4cbc45ce00117c549b9] | committer: Rémi Denis-Courmont 

Qt4: systray hides the interface when it is visible regardless of focus

Otherwise, if the interface is hidden behind another window, clicking
the tray icon however many times will request user attention in the task
bar and never actually show the interface. This was confusing and
inconvenient (fixes #2396). This new behavior is consistent with KMail.

It would probably be even better to show the interface on top (instead
of hiding it, then show it on the second click). Unfortunately, while it
does seem possible, I do not know how. For sure, the previous scheme did
not work anyway.

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

 modules/gui/qt4/main_interface.cpp |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 056d5fc..747bd62 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -866,7 +866,7 @@ void MainInterface::toggleUpdateSystrayMenu()
     }
     else
     {
-        /* Visible */
+        /* Visible (possibly under other windows) */
 #ifdef WIN32
         /* check if any visible window is above vlc in the z-order,
          * but ignore the ones always on top
@@ -879,18 +879,18 @@ void MainInterface::toggleUpdateSystrayMenu()
                     ( GetWindowInfo( hwnd, &wi ) &&
                       (wi.dwExStyle&WS_EX_NOACTIVATE) ) );
                 hwnd = GetNextWindow( hwnd, GW_HWNDPREV ) );
-        if( !hwnd || !GetWindowInfo( hwnd, &wi ) ||
+            if( !hwnd || !GetWindowInfo( hwnd, &wi ) ||
                 (wi.dwExStyle&WS_EX_TOPMOST) )
+            {
+                hide();
+            }
+            else
+            {
+                activateWindow();
+            }
 #else
-        if( isActiveWindow() )
+        hide();
 #endif
-        {
-            hide();
-        }
-        else
-        {
-            activateWindow();
-        }
     }
     QVLCMenu::updateSystrayMenu( this, p_intf );
 }




More information about the vlc-devel mailing list