From d238f985fbcff478b52d9459567d7280d83b0b8a Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 21 Jun 2020 01:20:57 +0000 Subject: [PATCH] GTK: filter events more precisely. Turns out that GDK_MOD2_MASK, at least on some systems, corresponds to NumLock. Use the function provided by GDK to handle this. Fixes #634. --- src/platform/guigtk.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/guigtk.cpp b/src/platform/guigtk.cpp index e68fd304..cd5d0b8d 100644 --- a/src/platform/guigtk.cpp +++ b/src/platform/guigtk.cpp @@ -565,7 +565,8 @@ protected: KeyboardEvent event = {}; event.type = type; - if(gdk_event->state & ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK)) { + Gdk::ModifierType mod_mask = get_modifier_mask(Gdk::MODIFIER_INTENT_DEFAULT_MOD_MASK); + if((gdk_event->state & mod_mask) & ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK)) { return false; }