On Sun May 25 15:34:38 2025 +0000, Alexandros Frantzis wrote:
Hi @yurih, from what I understand the reason alt(-tab) is problematic is because the alt menu mode is enabled when the key is released. However, avoiding the release just for this behavior doesn't seem like a viable way forward, since other applications may treat alt differently or may also require treating other keys the same way. I was experimenting a bit and sending WM_CANCELMODE (which winex11 does already) seems to help with the alt(-tab) menu situation in my tests. Could you try the following and let me know if it helps with your use case:
--- a/dlls/winewayland.drv/wayland_keyboard.c +++ b/dlls/winewayland.drv/wayland_keyboard.c @@ -800,6 +800,11 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard, * and for any key repetition to stop. */ release_all_keys(hwnd); + if (hwnd == NtUserGetForegroundWindow()) + { + if (!(NtUserGetWindowLongW(hwnd, GWL_STYLE) & WS_MINIMIZE)) + send_message(hwnd, WM_CANCELMODE, 0, 0); + } /* FIXME: update foreground window as well */ }
Yes it does indeed fix the alt menu mode without my patch. Though I don't think I understood clearly what you meant, as Alt is already filtered (VK_MENU), I just added the left and right keys as they are among the returned keyboard state and are not filtered, making Alt released anyway. You plan to remove the modifier's filtering altogether ?
Also, there's issues with extended scan code (for example my keyboard arrows) that aren't released, though it also happens with winex11.