[gtk+] wayland: Translate virtual modifiers too
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Translate virtual modifiers too
- Date: Sun, 15 Nov 2015 04:27:08 +0000 (UTC)
commit bc6d2d65fb5026d12adf88c6b111ef13095a0cc7
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Nov 3 18:39:27 2015 +0100
wayland: Translate virtual modifiers too
Wayland allows us to receive virtual modifiers too so we can just use
them directly if the compositor does send them.
https://bugzilla.gnome.org/show_bug.cgi?id=748904
gdk/wayland/gdkkeys-wayland.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index a0cc1f6..4819ab6 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -264,6 +264,12 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_LOGO);
if (state & GDK_MOD5_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod5");
+ if (state & GDK_SUPER_MASK)
+ mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Super");
+ if (state & GDK_HYPER_MASK)
+ mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Hyper");
+ if (state & GDK_META_MASK)
+ mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Meta");
return mods;
}
@@ -290,6 +296,12 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
state |= GDK_MOD4_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod5")))
state |= GDK_MOD5_MASK;
+ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Super")))
+ state |= GDK_SUPER_MASK;
+ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Hyper")))
+ state |= GDK_HYPER_MASK;
+ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Meta")))
+ state |= GDK_META_MASK;
return state;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]