unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob a58c448af9031a739574345fb9e1ee3dc3badfcc 1959 bytes (raw)
name: gnu/packages/patches/emacs-pgtk-super-key-fix.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
From a897516fc5ec380938115ad42023f279d128fc1e Mon Sep 17 00:00:00 2001
From: Andrew Tropin <andrew@trop.in>
Date: Fri, 16 Sep 2022 15:24:19 +0300
Subject: [PATCH] Workaround gtk bug for superkey handling

https://gitlab.gnome.org/GNOME/gtk/-/issues/4913
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55362
Patch based on Thomas Jost's suggestion.

---
 src/pgtkterm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 491ba33882..d5a9970693 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -5051,7 +5051,7 @@ pgtk_gtk_to_emacs_modifiers (struct pgtk_display_info *dpyinfo, int state)
     mod |= mod_ctrl;
   if (state & GDK_META_MASK || state & GDK_MOD1_MASK)
     mod |= mod_meta;
-  if (state & GDK_SUPER_MASK)
+  if (state & GDK_SUPER_MASK || state & GDK_MOD4_MASK)
     mod |= mod_super;
   if (state & GDK_HYPER_MASK)
     mod |= mod_hyper;
@@ -5184,7 +5184,7 @@ key_press_event (GtkWidget *widget, GdkEvent *event, gpointer *user_data)
       /* While super is pressed, the input method will always always
 	 resend the key events ignoring super.  As a workaround, don't
 	 filter key events with super or hyper pressed.  */
-      if (!(event->key.state & (GDK_SUPER_MASK | GDK_HYPER_MASK)))
+      if (!(event->key.state & (GDK_SUPER_MASK | GDK_MOD4_MASK | GDK_HYPER_MASK)))
 	{
 	  if (pgtk_im_filter_keypress (f, &event->key))
 	    return TRUE;
@@ -5199,8 +5199,9 @@ key_press_event (GtkWidget *widget, GdkEvent *event, gpointer *user_data)
       /* make_lispy_event turns chars into control chars.
          Don't do it here because XLookupString is too eager.  */
       state &= ~GDK_CONTROL_MASK;
-      state &= ~(GDK_META_MASK
-		 | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_MOD1_MASK);
+      state &= ~(GDK_META_MASK | GDK_MOD1_MASK
+		 | GDK_SUPER_MASK | GDK_MOD4_MASK
+		 | GDK_HYPER_MASK);
 
       nbytes = event->key.length;
       if (nbytes > copy_bufsiz)
-- 
2.37.3

debug log:

solving a58c448 ...
found a58c448 in https://yhetil.org/emacs-bugs/87r107zvnb.fsf@gnus.org/

applying [1/1] https://yhetil.org/emacs-bugs/87r107zvnb.fsf@gnus.org/
diff --git a/gnu/packages/patches/emacs-pgtk-super-key-fix.patch b/gnu/packages/patches/emacs-pgtk-super-key-fix.patch
new file mode 100644
index 0000000..a58c448

1:35: space before tab in indent.
 	 resend the key events ignoring super.  As a workaround, don't
1:36: space before tab in indent.
 	 filter key events with super or hyper pressed.  */
1:39: space before tab in indent.
 	{
1:40: space before tab in indent.
 	  if (pgtk_im_filter_keypress (f, &event->key))
1:41: space before tab in indent.
 	    return TRUE;
Checking patch gnu/packages/patches/emacs-pgtk-super-key-fix.patch...
Applied patch gnu/packages/patches/emacs-pgtk-super-key-fix.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

index at:
100644 a58c448af9031a739574345fb9e1ee3dc3badfcc	gnu/packages/patches/emacs-pgtk-super-key-fix.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).