GNU bug report logs - #57825
29.0.50; Superkey handling regression in pgtk

Previous Next

Package: emacs;

Reported by: Andrew Tropin <andrew <at> trop.in>

Date: Thu, 15 Sep 2022 08:55:02 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Po Lu <luangruo <at> yahoo.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: masmer4 <at> yahoo.co.jp, 57825 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: bug#57825: 29.0.50; Superkey handling regression in pgtk
Date: Mon, 19 Sep 2022 15:57:58 +0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Can't we check what compositor we're running under?

No, that is not really easy to do.

Kwin and Mutter apparently work correctly with GTK, but as I found out
earlier, the real problem lies in libxkbcommon, which is not working the
way XKB is supposed to, thus confusing GTK.

XKB_MOD_NAME_LOGO is not supposed to exist.  Instead, there should be
XKB_MOD_NAME_SUPER, defined to "Super".

Unfortunately, the libxkbcommon API is already set in stone, so the
easiest fix on the GTK side would be this:

diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 35ac9e8..c104b5a 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -254,7 +254,8 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
   if (state & GDK_ALT_MASK)
     mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
   if (state & GDK_SUPER_MASK)
-    mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Super");
+    mods |= (1 << xkb_keymap_mod_get_index (xkb_keymap, "Super")
+	     | 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_LOGO));
   if (state & GDK_HYPER_MASK)
     mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Hyper");
   if (state & GDK_META_MASK)
@@ -277,6 +278,8 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
     state |= GDK_CONTROL_MASK;
   if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
     state |= GDK_ALT_MASK;
+  if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_LOGO)))
+    state |= GDK_SUPER_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")))




This bug report was last modified 2 years and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.