From 9156f38ebb4e8e27dd725edcdcda63716afd7c30 Mon Sep 17 00:00:00 2001 From: Ivan Sorokin Date: Mon, 14 Oct 2024 08:53:54 +0200 Subject: [PATCH] wxGetKeyState() fails to return correct Alt state under X11 in some cases (at least in Cinnamon and KDE). Btw, according to docs, it should not work under X11 at all. See #2294 for details --- WinPort/src/Backend/WX/wxMain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WinPort/src/Backend/WX/wxMain.cpp b/WinPort/src/Backend/WX/wxMain.cpp index 3a7dc990c..c977c96f9 100644 --- a/WinPort/src/Backend/WX/wxMain.cpp +++ b/WinPort/src/Backend/WX/wxMain.cpp @@ -1304,7 +1304,7 @@ void WinPortPanel::OnKeyDown( wxKeyEvent& event ) // also it didnt cause problems yet if ( (_key_tracker.Shift() && !event.ShiftDown()) || ((_key_tracker.LeftControl() || _key_tracker.RightControl()) && !event.ControlDown())) { - if (_key_tracker.CheckForSuddenModifiersUp()) { + if ((!_key_tracker.Alt() || g_wayland) && _key_tracker.CheckForSuddenModifiersUp()) { _exclusive_hotkeys.Reset(); } } @@ -1438,7 +1438,7 @@ void WinPortPanel::OnKeyUp( wxKeyEvent& event ) #endif wxConsoleInputShim::Enqueue(&ir, 1); } - if (_key_tracker.CheckForSuddenModifiersUp()) { + if ((!_key_tracker.Alt() || g_wayland) && _key_tracker.CheckForSuddenModifiersUp()) { _exclusive_hotkeys.Reset(); } //event.Skip();