summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-04-27 14:06:38 +0200
committerEmmanuele Bassi <ebassi@gnome.org>2016-04-27 14:08:11 +0100
commit8f9693e02cf4586fc5985178b896faf58b88bb1f (patch)
tree1b020888fc57b476290fa05c0b6498ec6055a101
parent7dac5192777744f0eb5ab395f1bda33191b97714 (diff)
downloadgtk+-8f9693e02cf4586fc5985178b896faf58b88bb1f.tar.gz
wayland: Ignore NoSymbol keys
NoSymbol is not a valid GDK symbol (it only has the concept of VoidSymbol, for some reason, which is neither the same thing nor produced by any sane keymap). Passing NoSymbol events through to GTK+ apps is unlikely to produce anything useful. In particular, this meant VTE would scroll to the end of the buffer when pressing Fn (required for Page Up/Down on Macs), as it was receiving a keypress that wasn't a modifeir. This does not happen on X11, as the KEY_FN keycode is above 255, so does not get sent to clients. https://bugzilla.gnome.org/show_bug.cgi?id=764825
-rw-r--r--gdk/wayland/gdkdevice-wayland.c3
-rw-r--r--gdk/wayland/gdkkeys-wayland.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 4745357fe3..efaed86e6c 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1735,6 +1735,9 @@ deliver_key_event (GdkWaylandSeat *seat,
sym = xkb_state_key_get_one_sym (xkb_state, key);
+ if (sym == XKB_KEY_NoSymbol)
+ return;
+
seat->time = time_;
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 229eedb801..c702c640cf 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -351,7 +351,7 @@ gdk_wayland_keymap_translate_keyboard_state (GdkKeymap *keymap,
if (consumed_modifiers)
*consumed_modifiers = get_gdk_modifiers (xkb_keymap, consumed);
- return TRUE;
+ return (sym != XKB_KEY_NoSymbol);
}
static guint