Fix the wayland side of https://bugs.winehq.org/show_bug.cgi?id=55336
### Exit menu key by default:
That's the actual behavior, any non-special key will exit the menu key, and be sent to the client.
I was also wondering if we should add `menu_sys_key = f10_key = 0;` when receiving a `WM_ACTIVATE` in `win32u/defwnd.c`'s `default_window_proc` but I guess not ?
### Fix repeated key for no reason:
For some reason when ALT is pressed, it is spammed and thus spams SYS_COMMAND. This fix that, but I don't know what I am doing here. I don't see any repeating key spamming with winex11 but I could be wrong. However alt/SYS_COMMAND should not be repeated.
That wasn't happening with winex11.drv.
### Fix release_all_keys modifier filtering:
That was the main reason why alt-tab leads to the menu key, NtUserGetAsyncKeyboardState also uses left and right system keys.
-- v4: winewayland.drv: Fix release_all_keys modifier filtering server: Fix repeated key for no reason win32u: Exit menu key by default
From: yuri_k7 riyu12383@gmail.com
--- dlls/win32u/menu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/menu.c b/dlls/win32u/menu.c index f232585940d..84556b95afa 100644 --- a/dlls/win32u/menu.c +++ b/dlls/win32u/menu.c @@ -4242,10 +4242,6 @@ static BOOL track_menu( HMENU hmenu, UINT flags, int x, int y, HWND hwnd, const menu_right_key( &mt, flags, msg.message ); break;
- case VK_ESCAPE: - exit_menu = menu_key_escape( &mt, flags ); - break; - case VK_F1: { HELPINFO hi; @@ -4262,8 +4258,9 @@ static BOOL track_menu( HMENU hmenu, UINT flags, int x, int y, HWND hwnd, const break; }
+ case VK_ESCAPE: default: - NtUserTranslateMessage( &msg, 0 ); + exit_menu = menu_key_escape( &mt, flags ); break; } break; /* WM_KEYDOWN */
From: yuri_k7 riyu12383@gmail.com
--- server/queue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 24c8cfb8385..24109911871 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2433,11 +2433,10 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c } }
- if (origin == IMO_HARDWARE) + if ((origin == IMO_HARDWARE) && (input->kbd.scan == desktop->key_repeat.input.kbd.scan)) { /* if the repeat key is released, stop auto-repeating */ - if (((input->kbd.flags & KEYEVENTF_KEYUP) && - (input->kbd.scan == desktop->key_repeat.input.kbd.scan))) + if (input->kbd.flags & KEYEVENTF_KEYUP) { stop_key_repeat( desktop ); }
From: yuri_k7 riyu12383@gmail.com
--- dlls/winewayland.drv/wayland_keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winewayland.drv/wayland_keyboard.c b/dlls/winewayland.drv/wayland_keyboard.c index 8f7b6dce30f..9b382204f0b 100644 --- a/dlls/winewayland.drv/wayland_keyboard.c +++ b/dlls/winewayland.drv/wayland_keyboard.c @@ -629,8 +629,8 @@ static void release_all_keys(HWND hwnd) { /* Skip mouse buttons. */ if (vkey < 7 && vkey != VK_CANCEL) continue; - /* Skip left/right-agnostic modifier vkeys. */ - if (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU) continue; + /* Skip modifier vkeys. */ + if (vkey == VK_SHIFT || vkey == VK_CONTROL || vkey == VK_MENU || (vkey >= VK_LSHIFT && vkey <= VK_RMENU)) continue;
if (state[vkey] & 0x80) {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=149707
Your paranoid android.
=== debian11b (64 bit WoW report) ===
comctl32: edit.c:2784: Test failed: Expected 1 EM_SETSEL message, got 0
user32: edit.c:2750: Test failed: Expected 1 EM_SETSEL message, got 0 input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000013F00F4, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032 menu: Timeout msg.c:17600: Test failed: popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17600: Test failed: popup menu command: 11: the winevent_hook 0x8000 was expected, but got msg 0x011f instead msg.c:17600: Test failed: popup menu command: 13: the winevent_hook 0x8002 was expected, but got msg 0x011f instead msg.c:17600: Test failed: popup menu command: 14: the winevent_hook 0x800b was expected, but got msg 0x011f instead msg.c:17600: Test failed: popup menu command: 16: in msg 0x011f expecting wParam 0x8000c8 got 0xffff0000 msg.c:17600: Test failed: popup menu command: 24: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17600: Test failed: popup menu command: 25: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17600: Test failed: popup menu command: 26: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17600: Test failed: popup menu command: 27: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17600: Test failed: popup menu command: 29: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17600: Test failed: popup menu command: 29: the msg 0x0126 was expected, but got msg 0x0101 instead msg.c:17600: Test failed: popup menu command: 31: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17600: Test failed: popup menu command: 32: the msg sequence is not complete: expected msg 0000 - actual msg 0100 msg.c:17618: Test failed: submenu of a popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17618: Test failed: submenu of a popup menu command: 10: in msg 0x011f expecting wParam 0x900000 got 0xffff0000 msg.c:17618: Test failed: submenu of a popup menu command: 12: the hook 0x0003 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 13: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 15: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 16: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 18: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 25: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 27: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 28: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 36: the hook 0x0004 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 37: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 38: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 39: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 42: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 43: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 44: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 45: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17618: Test failed: submenu of a popup menu command: 47: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17618: Test failed: submenu of a popup menu command: 47: the msg 0x0126 was expected, but got msg 0x0101 instead msg.c:17618: Test failed: submenu of a popup menu command: 49: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17618: Test failed: submenu of a popup menu command: 50: the msg sequence is not complete: expected msg 0000 - actual msg 0100 msg.c:17633: Test failed: single menu item command: 11: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17666: Test failed: submenu of a popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17666: Test failed: submenu of a popup menu command: 10: in msg 0x011f expecting wParam 0x900000 got 0xffff0000 msg.c:17666: Test failed: submenu of a popup menu command: 12: the hook 0x0003 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 13: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 15: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 16: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 18: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 25: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 27: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 28: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 36: the hook 0x0004 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 37: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 38: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 39: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 42: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 43: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 44: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 45: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17666: Test failed: submenu of a popup menu command: 47: the msg 0x0111 was expected, but got msg 0x0105 instead msg.c:17666: Test failed: submenu of a popup menu command: 47: the msg 0x0111 was expected, but got msg 0x0101 instead msg.c:17666: Test failed: submenu of a popup menu command: 49: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17666: Test failed: submenu of a popup menu command: 50: the msg sequence is not complete: expected msg 0000 - actual msg 0100 win.c:4073: Test succeeded inside todo block: Expected active window 0000000000D60186, got 0000000000D60186. win.c:4074: Test succeeded inside todo block: Expected focus window 0000000000D60186, got 0000000000D60186.
@rbernon Gentle ping.
This is a very simple fix for a global winewayland alt tabbing issue, though I'm not sure about the middle commit.
The original issue is about winex11 and dinput, either destroying the device or not starting the input thread because the window is not in focus.
On Mon Nov 18 01:49:37 2024 +0000, YuriK7 wrote:
@rbernon Gentle ping. This is a very simple fix for a global winewayland alt tabbing issue, though I'm not sure about the middle commit. The original issue is about winex11 and dinput, either destroying the device or not starting the input thread because the window is not in focus.
It still seems to be a draft, which is maybe why no-one has reviewed it.