Skip to content

Commit

Permalink
wxGetKeyState() fails to return correct Alt state under X11 in some c…
Browse files Browse the repository at this point in the history
…ases (at least in Cinnamon and KDE).

Btw, according to docs, it should not work under X11 at all.
See elfmz#2294 for details
  • Loading branch information
unxed committed Oct 14, 2024
1 parent ec6b728 commit 9156f38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions WinPort/src/Backend/WX/wxMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 9156f38

Please sign in to comment.