From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: masmer4@yahoo.co.jp, 57825@debbugs.gnu.org,
Andrew Tropin <andrew@trop.in>
Subject: bug#57825: 29.0.50; Superkey handling regression in pgtk
Date: Mon, 19 Sep 2022 15:57:58 +0800 [thread overview]
Message-ID: <8735cnre2h.fsf@yahoo.com> (raw)
In-Reply-To: <87fsgnzu36.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 19 Sep 2022 09:44:45 +0200")
Lars Ingebrigtsen <larsi@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")))
next prev parent reply other threads:[~2022-09-19 7:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 8:53 bug#57825: 29.0.50; Superkey handling regression in pgtk Andrew Tropin
2022-09-15 11:07 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-16 4:25 ` Andrew Tropin
2022-09-16 5:49 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-19 5:02 ` Andrew Tropin
2022-09-19 5:19 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-19 8:09 ` Andrew Tropin
2022-09-19 7:11 ` Lars Ingebrigtsen
2022-09-19 7:22 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-19 7:44 ` Lars Ingebrigtsen
2022-09-19 7:57 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-19 8:15 ` Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735cnre2h.fsf@yahoo.com \
--to=bug-gnu-emacs@gnu.org \
--cc=57825@debbugs.gnu.org \
--cc=andrew@trop.in \
--cc=larsi@gnus.org \
--cc=luangruo@yahoo.com \
--cc=masmer4@yahoo.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.