Don't use SWP_NOACTIVATE when we changing focus and do need to activate window.

Vitaliy Margolen wine-patch at kievinfo.com
Tue Nov 29 15:54:17 CST 2005


ChangeLog:
Don't use SWP_NOACTIVATE when we changing focus and do need to activate window.

 dlls/user/focus.c     |    5 +++--
 dlls/user/tests/msg.c |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
-------------- next part --------------
55a318f75a80b4ecd13cc5a1ca3b96ce8e130ba7
diff --git a/dlls/user/focus.c b/dlls/user/focus.c
index aa14a4d..0b14432 100644
--- a/dlls/user/focus.c
+++ b/dlls/user/focus.c
@@ -110,13 +110,14 @@ static BOOL set_active_window( HWND hwnd
 
     if (hwnd)
     {
+        LONG style = GetWindowLongW( hwnd, GWL_STYLE );
         /* send palette messages */
         if (SendMessageW( hwnd, WM_QUERYNEWPALETTE, 0, 0 ))
             SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTEISCHANGING, (WPARAM)hwnd, 0,
                                  SMTO_ABORTIFHUNG, 2000, NULL );
 
-        if (!GetPropA( hwnd, "__wine_x11_managed" ))
-            SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
+        if (!GetPropA( hwnd, "__wine_x11_managed" ) && style & WS_POPUP)
+            SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
 
         if (!IsWindow(hwnd)) return FALSE;
     }
diff --git a/dlls/user/tests/msg.c b/dlls/user/tests/msg.c
index b31794c..ed6302e 100644
--- a/dlls/user/tests/msg.c
+++ b/dlls/user/tests/msg.c
@@ -3130,7 +3130,7 @@ static void test_showwindow(void)
     hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_VISIBLE,
                            100, 100, 200, 200, 0, 0, 0, NULL);
     ok (hwnd != 0, "Failed to create popup window\n");
-    ok_sequence(WmCreatePopupSeq, "CreateWindow(WS_VISIBLE):popup", TRUE);
+    ok_sequence(WmCreatePopupSeq, "CreateWindow(WS_VISIBLE):popup", FALSE);
     trace("done\n");
 
     trace("calling ShowWindow( SW_SHOWMAXIMIZE ) for visible popup window\n");


More information about the wine-patches mailing list