Vladimir Panteleev : user32: Update last active popup for all parents.

Alexandre Julliard julliard at winehq.org
Mon Oct 18 13:36:57 CDT 2010


Module: wine
Branch: master
Commit: 824c5089d2f0e7257111a65d65e8db94b113c5fa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=824c5089d2f0e7257111a65d65e8db94b113c5fa

Author: Vladimir Panteleev <vladimir at thecybershadow.net>
Date:   Sat Oct 16 20:22:58 2010 +0300

user32: Update last active popup for all parents.

---

 dlls/user32/tests/win.c |   23 +++++++++++++++++++++++
 server/window.c         |   10 +++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 12f2e1c..0acd704 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -6256,6 +6256,28 @@ todo_wine
     ok( found != NULL, "found is NULL, expected a valid hwnd\n" );
 }
 
+static void test_GetLastActivePopup(void)
+{
+    HWND hwndOwner, hwndPopup1, hwndPopup2;
+
+    hwndOwner = CreateWindowExA(0, "MainWindowClass", NULL,
+                                WS_VISIBLE | WS_POPUPWINDOW,
+                                100, 100, 200, 200,
+                                NULL, 0, GetModuleHandle(0), NULL);
+    hwndPopup1 = CreateWindowExA(0, "MainWindowClass", NULL,
+                                 WS_VISIBLE | WS_POPUPWINDOW,
+                                 100, 100, 200, 200,
+                                 hwndOwner, 0, GetModuleHandle(0), NULL);
+    hwndPopup2 = CreateWindowExA(0, "MainWindowClass", NULL,
+                                 WS_VISIBLE | WS_POPUPWINDOW,
+                                 100, 100, 200, 200,
+                                 hwndPopup1, 0, GetModuleHandle(0), NULL);
+    ok( GetLastActivePopup(hwndOwner) == hwndPopup2, "wrong last active popup\n" );
+    DestroyWindow( hwndPopup2 );
+    DestroyWindow( hwndPopup1 );
+    DestroyWindow( hwndOwner );
+}
+
 START_TEST(win)
 {
     HMODULE user32 = GetModuleHandleA( "user32.dll" );
@@ -6329,6 +6351,7 @@ START_TEST(win)
     test_children_zorder(hwndMain);
     test_popup_zorder(hwndMain2, hwndMain, WS_POPUP);
     test_popup_zorder(hwndMain2, hwndMain, 0);
+    test_GetLastActivePopup();
     test_keyboard_input(hwndMain);
     test_mouse_input(hwndMain);
     test_validatergn(hwndMain);
diff --git a/server/window.c b/server/window.c
index 503f37e..635dd9b 100644
--- a/server/window.c
+++ b/server/window.c
@@ -569,9 +569,13 @@ int make_window_active( user_handle_t window )
 
     if (!win) return 0;
 
-    /* set last active for window and its owner */
-    win->last_active = win->handle;
-    if ((owner = get_user_object( win->owner, USER_WINDOW ))) owner->last_active = win->handle;
+    /* set last active for window and its owners */
+    owner = win;
+    while (owner)
+    {
+        owner->last_active = win->handle;
+        owner = get_user_object( owner->owner, USER_WINDOW );
+    }
     return 1;
 }
 




More information about the wine-cvs mailing list