[3/5] user32: Set capture on the owner of popup menus.

Vincent Povirk madewokherd at gmail.com
Tue Jun 24 14:53:53 CDT 2014


-------------- next part --------------
From 0c06ac56b884ecae294b3e1ebe9405fea2501049 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Tue, 25 Mar 2014 13:17:26 -0500
Subject: [PATCH 3/5] user32: Set capture on the owner of popup menus.

---
 dlls/user32/menu.c      | 3 +--
 dlls/user32/tests/msg.c | 8 ++++----
 dlls/user32/tests/win.c | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 93bee49..3179a32 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -3025,8 +3025,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
 
     if (wFlags & TF_ENDMENU) fEndMenu = TRUE;
 
-    /* owner may not be visible when tracking a popup, so use the menu itself */
-    capture_win = (wFlags & TPM_POPUPMENU) ? menu->hWnd : mt.hOwnerWnd;
+    capture_win = mt.hOwnerWnd;
     set_capture_window( capture_win, GUI_INMENUMODE, NULL );
 
     __TRY while (!fEndMenu)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 66b9c7e..841c5da 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -14369,7 +14369,7 @@ static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam,
 
     switch (message) {
     case WM_ENTERIDLE:
-        todo_wine ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture());
+        ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture());
         EndMenu();
         break;
     case WM_INITMENU:
@@ -14378,7 +14378,7 @@ static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam,
         ok((HMENU)wParam == hpopupmenu, "expected %p, got %lx\n", hpopupmenu, wParam);
         break;
     case WM_CAPTURECHANGED:
-        todo_wine ok(!lParam || (HWND)lParam == hwnd, "lost capture to %lx\n", lParam);
+        ok(!lParam || (HWND)lParam == hwnd, "lost capture to %lx\n", lParam);
         break;
     }
 
@@ -14419,7 +14419,7 @@ static void test_TrackPopupMenu(void)
     flush_events();
     flush_sequence();
     ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
-    ok_sequence(WmTrackPopupMenu, "TrackPopupMenu", TRUE);
+    ok_sequence(WmTrackPopupMenu, "TrackPopupMenu", FALSE);
     ok(ret == 1, "TrackPopupMenu failed with error %i\n", GetLastError());
 
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_init_proc);
@@ -14427,7 +14427,7 @@ static void test_TrackPopupMenu(void)
     flush_events();
     flush_sequence();
     ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
-    ok_sequence(WmTrackPopupMenuAbort, "WmTrackPopupMenuAbort", TRUE);
+    ok_sequence(WmTrackPopupMenuAbort, "WmTrackPopupMenuAbort", FALSE);
     ok(ret == TRUE, "TrackPopupMenu failed\n");
 
     SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc);
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index bf9bb2c..e4c6e93 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3072,7 +3072,7 @@ static LRESULT CALLBACK test_capture_4_proc(HWND hWnd, UINT msg, WPARAM wParam,
             cap_wnd = GetCapture();
 
             ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %lx\n", cap_wnd, lParam);
-            todo_wine ok(cap_wnd == hWnd, "capture window %p does not match hwnd %p\n", cap_wnd, hWnd);
+            ok(cap_wnd == hWnd, "capture window %p does not match hwnd %p\n", cap_wnd, hWnd);
 
             /* check that re-setting the capture for the menu fails */
             set_cap_wnd = SetCapture(cap_wnd);
-- 
1.8.3.2



More information about the wine-patches mailing list