Commit 906db769 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

user32: Skip menu loop for empty popup menus.

parent a9bff001
......@@ -3033,6 +3033,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y,
if (!(wFlags & TPM_POPUPMENU))
set_capture_window( mt.hOwnerWnd, GUI_INMENUMODE, NULL );
if ((wFlags & TPM_POPUPMENU) && menu->nItems == 0)
return FALSE;
__TRY while (!fEndMenu)
{
menu = MENU_GetMenu( mt.hCurrentMenu );
......
......@@ -3820,25 +3820,25 @@ static void test_emptypopup(void)
ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup);
ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop);
ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu);
todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0;
selectitem_wp = 0xdeadbeef;
selectitem_lp = 0xdeadbeef;
ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL);
todo_wine ok(ret == 0, "got %i\n", ret);
ok(ret == 0, "got %i\n", ret);
ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup);
ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop);
ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu);
todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu);
todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp);
ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp);
SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_fill_in_init);
......
......@@ -15373,7 +15373,7 @@ static void test_TrackPopupMenuEmpty(void)
flush_sequence();
ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
ok_sequence(WmTrackPopupMenuEmpty, "TrackPopupMenuEmpty", TRUE);
todo_wine ok(ret == 0, "TrackPopupMenu succeeded\n");
ok(ret == 0, "TrackPopupMenu succeeded\n");
DestroyMenu(hpopupmenu);
DestroyWindow(hwnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment