--- modules/gui/qt4/main_interface.cpp	Tue Aug  7 20:45:56 2007
+++ modules/gui/qt4/main_interface.cpp	Wed Aug  8 16:51:17 2007
@@ -463,10 +463,26 @@
     if( isHidden() )
     {
         show();
+#ifdef WIN32
+        activateWindow();
+#endif
     }
     else
     {
+#ifdef WIN32
+        /* check if any visible window is above vlc in the z-order,
+         * but ignore the ones always on top */
+        WINDOWINFO wi;
+        HWND hwnd;
+        wi.cbSize = sizeof( WINDOWINFO );
+        for( hwnd = GetNextWindow( internalWinId(), GW_HWNDPREV );
+                hwnd && !IsWindowVisible( hwnd );
+                hwnd = GetNextWindow( hwnd, GW_HWNDPREV ) );
+        if( !hwnd || !GetWindowInfo( hwnd, &wi ) ||
+                (wi.dwExStyle&WS_EX_TOPMOST) )
+#else
         if( isActiveWindow() )
+#endif
         {
             hide();
         }
