Skip to content

Commit

Permalink
winex11: Send SC_KEYMENU on managed windows.
Browse files Browse the repository at this point in the history
Fixes https://bugs.winehq.org/show_bug.cgi?id=21918

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
  • Loading branch information
alexhenrie committed Nov 10, 2018
1 parent e9e12bd commit 5fde7ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
5 changes: 2 additions & 3 deletions dlls/user32/tests/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -8826,8 +8826,7 @@ static void test_accelerators(void)
keybd_event(VK_MENU, 0, 0, 0);
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
pump_msg_loop(hwnd, 0);
/* this test doesn't pass in Wine for managed windows */
ok_sequence(WmAltPressRelease, "Alt press/release", TRUE);
ok_sequence(WmAltPressRelease, "Alt press/release", FALSE);

trace("testing VK_F1 press/release\n");
keybd_event(VK_F1, 0, 0, 0);
Expand All @@ -8847,7 +8846,7 @@ static void test_accelerators(void)
keybd_event(VK_F10, 0, 0, 0);
keybd_event(VK_F10, 0, KEYEVENTF_KEYUP, 0);
pump_msg_loop(hwnd, 0);
ok_sequence(WmVkF10Seq, "VK_F10 press/release", TRUE);
ok_sequence(WmVkF10Seq, "VK_F10 press/release", FALSE);

trace("testing SHIFT+F10 press/release\n");
keybd_event(VK_SHIFT, 0, 0, 0);
Expand Down
11 changes: 0 additions & 11 deletions dlls/winex11.drv/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2789,17 +2789,6 @@ LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
default: dir = _NET_WM_MOVERESIZE_SIZE_KEYBOARD; break;
}
break;

case SC_KEYMENU:
/* prevent a simple ALT press+release from activating the system menu,
* as that can get confusing on managed windows */
if ((WCHAR)lparam) goto failed; /* got an explicit char */
if (GetMenu( hwnd )) goto failed; /* window has a real menu */
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_SYSMENU)) goto failed; /* no system menu */
TRACE( "ignoring SC_KEYMENU wp %lx lp %lx\n", wparam, lparam );
release_win_data( data );
return 0;

default:
goto failed;
}
Expand Down

0 comments on commit 5fde7ce

Please sign in to comment.