user32: Add checking to the wm for hunk of the eterbug #1837 hack (eterbug #3994)
authorIlya Shpigor <shpigor@etersoft.ru>
Thu, 10 Sep 2009 06:54:45 +0000 (10:54 +0400)
committerVitaly Lipatov <lav@etersoft.ru>
Wed, 23 Sep 2009 17:37:37 +0000 (21:37 +0400)
dlls/user32/focus.c

index 2cb1b28a778129b9a6f6725044d49d1978ebcc0e..7d646b26dc7e9657a9520e88441ca826640ece33 100644 (file)
@@ -33,6 +33,7 @@
 #include "wine/server.h"
 #include "wine/debug.h"
 
+#define ETERSOFT_FUNC_GETWM
 #include "wine/etersoft.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(win);
@@ -140,17 +141,22 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
             SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
                                  SMTO_ABORTIFHUNG, 2000, NULL );
 
-        LOADETER_FUNC(etersoft_1version);
-        if ( etersoft_1version && ((etersoft_1version() == 8) || (etersoft_1version() == 7)) )
+        /* This hack is needed to solve
+         * eterbug #1837 in Gnome only
+         */
+        LOADETER_FUNC(etersoft_getwm)
+        if (etersoft_getwm() == 2)
         {
-             if(!GetPropA( hwnd, "__wine_x11_managed" ) && (etersoft_1version() == 8))
-                SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE /*| SWP_NOACTIVATE*/);
-             if(GetWindowLongW( hwnd, GWL_STYLE) & WS_POPUP)
-                SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
+            LOADETER_FUNC(etersoft_1version);
+            if ( etersoft_1version && ((etersoft_1version() == 8) || (etersoft_1version() == 7)) )
+            {
+                 if((!GetPropA( hwnd, "__wine_x11_managed" ) && (etersoft_1version() == 8))
+                    || (GetWindowLongW( hwnd, GWL_STYLE ) & WS_POPUP))
+                    SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
+            }
+            else
+                 SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
         }
-        else
-             SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE /*| SWP_NOACTIVATE*/);
-
         if (!IsWindow(hwnd)) return FALSE;
     }