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.
-- v7: winewayland.drv: Fix release_all_keys modifier filtering 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
--- 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=150750
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 menu: Timeout msg.c:17603: Test failed: popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17603: Test failed: popup menu command: 11: the winevent_hook 0x8000 was expected, but got msg 0x011f instead msg.c:17603: Test failed: popup menu command: 13: the winevent_hook 0x8002 was expected, but got msg 0x011f instead msg.c:17603: Test failed: popup menu command: 14: the winevent_hook 0x800b was expected, but got msg 0x011f instead msg.c:17603: Test failed: popup menu command: 16: in msg 0x011f expecting wParam 0x8000c8 got 0xffff0000 msg.c:17603: Test failed: popup menu command: 24: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17603: Test failed: popup menu command: 25: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17603: Test failed: popup menu command: 26: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17603: Test failed: popup menu command: 27: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17603: Test failed: popup menu command: 29: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17603: Test failed: popup menu command: 29: the msg 0x0126 was expected, but got msg 0x0101 instead msg.c:17603: Test failed: popup menu command: 31: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17603: Test failed: popup menu command: 32: the msg sequence is not complete: expected msg 0000 - actual msg 0100 msg.c:17621: Test failed: submenu of a popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17621: Test failed: submenu of a popup menu command: 10: in msg 0x011f expecting wParam 0x900000 got 0xffff0000 msg.c:17621: Test failed: submenu of a popup menu command: 12: the hook 0x0003 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 13: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 15: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 16: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 18: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 25: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 27: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 28: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 36: the hook 0x0004 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 37: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 38: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 39: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 42: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 43: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 44: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 45: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17621: Test failed: submenu of a popup menu command: 47: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17621: Test failed: submenu of a popup menu command: 47: the msg 0x0126 was expected, but got msg 0x0101 instead msg.c:17621: Test failed: submenu of a popup menu command: 49: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17621: Test failed: submenu of a popup menu command: 50: the msg sequence is not complete: expected msg 0000 - actual msg 0100 msg.c:17636: Test failed: single menu item command: 11: the msg 0x0126 was expected, but got msg 0x0105 instead msg.c:17669: Test failed: submenu of a popup menu command: 9: the msg 0x0117 was expected, but got msg 0x011f instead msg.c:17669: Test failed: submenu of a popup menu command: 10: in msg 0x011f expecting wParam 0x900000 got 0xffff0000 msg.c:17669: Test failed: submenu of a popup menu command: 12: the hook 0x0003 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 13: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 15: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 16: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 18: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 25: the winevent_hook 0x8000 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 27: the winevent_hook 0x8002 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 28: the winevent_hook 0x800b was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 36: the hook 0x0004 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 37: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 38: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 39: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 42: the winevent_hook 0x8003 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 43: the winevent_hook 0x8001 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 44: the msg 0x0125 was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 45: the msg 0x011f was expected, but got msg 0x0212 instead msg.c:17669: Test failed: submenu of a popup menu command: 47: the msg 0x0111 was expected, but got msg 0x0105 instead msg.c:17669: Test failed: submenu of a popup menu command: 47: the msg 0x0111 was expected, but got msg 0x0101 instead msg.c:17669: Test failed: submenu of a popup menu command: 49: in msg 0x0101 expecting wParam 0xd got 0x12 msg.c:17669: Test failed: submenu of a popup menu command: 50: the msg sequence is not complete: expected msg 0000 - actual msg 0100
I've removed the draft tag and the commit I was totally unsure of.
Here it is for history: ``` commit d4210fa9164e752faf3179fd559969be5ddaeaeb Author: yuri_k7 riyu12383@gmail.com Date: Sat Aug 3 22:01:28 2024 +0200
server: Fix repeated key for no reason
diff --git a/server/queue.c b/server/queue.c index 76a82dcf712..3d734d416b3 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2434,11 +2434,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 ); }
```
As the mr is now it's a simple fix for the winewayland.drv alt-tabbing out behavior. There's still a issue because NtUserGetAsyncKeyboardState used in release_all_keys is limited to 256 vkeys, scan codes outside that set of values are not updated.