GNU bug report logs - #53200
29.0.50; C-S-u shortcut fails with 'PGTK' enable

Previous Next

Package: emacs;

Reported by: Campbell Barton <ideasman42 <at> gmail.com>

Date: Wed, 12 Jan 2022 04:57:01 UTC

Severity: normal

Tags: moreinfo

Merged with 49211, 51002, 55362, 55660, 56653

Found in versions 28.0.50, 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53200 in the body.
You can then email your comments to 53200 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Wed, 12 Jan 2022 04:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Campbell Barton <ideasman42 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Jan 2022 04:57:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Campbell Barton <ideasman42 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Wed, 12 Jan 2022 15:56:03 +1100
With PGTK enabled (--with-pgtk) the following occurs:

- Press C-S-u
- Press a

The character 'a' is entered.

Without PGTK enabled, the following occurs:

- Press C-S-u
- Press a

The character 'aaaa' is entered 4x.

Note that PGTK seems to swallow this binding, since it's not possible to
check what the shortcut does by pressing:

C-H, K, C-S-u

Which reports without PGTK: (universal-argument)



In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.31, cairo version 1.17.4)
 of 2022-01-12 built on austpc
Repository revision: 8555a3e1ed1d34cbaa172bde86eb3b11a1cd7940
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --prefix=/opt/emacs --with-sound=no --disable-acl
 --with-file-notification=no --with-xpm --with-native-compilation
 --with-jpeg --with-tiff --with-gif --with-png --without-rsvg
 --without-lcms2 --without-libsystemd --without-gsettings
 --without-harfbuzz --without-m17n-flt --without-libotf --without-gpm
 --without-dbus --without-gsettings --without-gconf --without-selinux
 --without-gnutls --with-pgtk --without-makeinfo --without-libgmp
 --with-zlib --with-compress-install --with-threads
 --without-toolkit-scroll-bars --with-x-toolkit=gtk3 --with-xft
 --with-modules 'CFLAGS=-O3 -mtune=native -march=native -pipe
 -fomit-frame-pointer''

Configured features:
CAIRO FREETYPE GIF GLIB JPEG JSON LIBXML2 MODULES NATIVE_COMP PDUMPER
PGTK PNG SECCOMP SQLITE3 THREADS TIFF WEBP XIM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media rmc puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date seq gv
subr-x byte-opt bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget keymap hashtable-print-readable backquote threads
dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit
pgtk multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 45508 6842)
 (symbols 48 5609 1)
 (strings 32 18557 3267)
 (string-bytes 1 622864)
 (vectors 16 10816)
 (vector-slots 8 157953 15748)
 (floats 8 25 28)
 (intervals 56 255 0)
 (buffers 992 11))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Wed, 12 Jan 2022 06:25:01 GMT) Full text and rfc822 format available.

Message #8 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Campbell Barton <ideasman42 <at> gmail.com>
Cc: 53200 <at> debbugs.gnu.org
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Wed, 12 Jan 2022 14:24:35 +0800
Campbell Barton <ideasman42 <at> gmail.com> writes:

> With PGTK enabled (--with-pgtk) the following occurs:
>
> - Press C-S-u
> - Press a
>
> The character 'a' is entered.
>
> Without PGTK enabled, the following occurs:
>
> - Press C-S-u
> - Press a
>
> The character 'aaaa' is entered 4x.
>
> Note that PGTK seems to swallow this binding, since it's not possible to
> check what the shortcut does by pressing:
>
> C-H, K, C-S-u
>
> Which reports without PGTK: (universal-argument)

This has been reported at least twice already.  Someone should volunteer
to find and merge all those bugs, but in short: most GTK input method
modules stupidly eat the shift modifier, and the only workaround is to
disable the use of GTK input methods by setting `pgtk-use-im-context' to
nil.

This is really a bug in the various input modules and should be reported
to their developers instead instead.  If you're using ibus, for example,
complain to ibus developers about their IM context not setting the shift
modifier mask in an event sent by the filter.

Alternatively, you can use the regular X build, which is a much superior
experience over the PGTK port as long as you're not using Wayland.

Thanks, and please let us know about the progress of your complaining to
the IM module developers.  It would be greatly appreciated.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Thu, 13 Jan 2022 07:09:01 GMT) Full text and rfc822 format available.

Message #11 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 53200 <at> debbugs.gnu.org, Campbell Barton <ideasman42 <at> gmail.com>
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Thu, 13 Jan 2022 08:08:04 +0100
Po Lu <luangruo <at> yahoo.com> writes:

> This has been reported at least twice already.  Someone should volunteer
> to find and merge all those bugs

I found bug#49211, which seems to be the same problem, so I've merged
this with that one.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Forcibly Merged 49211 53200. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 13 Jan 2022 07:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Thu, 13 Jan 2022 08:06:01 GMT) Full text and rfc822 format available.

Message #16 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53200 <at> debbugs.gnu.org, Campbell Barton <ideasman42 <at> gmail.com>
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Thu, 13 Jan 2022 16:04:50 +0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I found bug#49211, which seems to be the same problem, so I've merged
> this with that one.

Great, thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Fri, 15 Apr 2022 02:02:01 GMT) Full text and rfc822 format available.

Message #19 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Smith <morgan.j.smith <at> outlook.com>
To: 53200 <at> debbugs.gnu.org, luangruo <at> yahoo.com
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Thu, 14 Apr 2022 22:01:30 -0400
Hello,

I'd like to report that my super key stopped registering.  I 
suspected commit 1404e16975 caused it so I did a quick `git revert 
1404e16975` ontop of 807682de1e and that fixed it.

I'm running pgtk on wayland with (pgtk-use-im-context nil) 
(although that doesn't seem to affect this issue). 

Thanks,

Morgan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Sun, 22 May 2022 16:26:02 GMT) Full text and rfc822 format available.

Message #22 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: daanturo <daanturo <at> gmail.com>
To: morgan.j.smith <at> outlook.com
Cc: 53200 <at> debbugs.gnu.org
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Sun, 22 May 2022 23:25:05 +0700
> I'd like to report that my super key stopped registering.  I   
> suspected commit 1404e16975 caused it so I did a quick `git revert   
> 1404e16975` ontop of 807682de1e and that fixed it.
 
Hello,
 
I can't find commit 1404e16975 in Emacs' master tree, but even when having IM disabled via `(setq pgtk-use-im-context-on-new-connection nil)` in init.el, Emacs is unable to recognize any Super-modified keys.
 
It's reproducible in `emacs -q` then `(pgtk-use-im-context nil)`.
 
I'm on Emacs master (8f3e0ed2b99b9b2ad42693cab2b3c0c291e3c3d0).
 
--  
Daanturo.





Forcibly Merged 49211 53200 55362. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 22 May 2022 16:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Sun, 22 May 2022 17:46:01 GMT) Full text and rfc822 format available.

Message #27 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Smith <morgan.j.smith <at> outlook.com>
To: daanturo <daanturo <at> gmail.com>
Cc: luangruo <at> yahoo.com, 53200 <at> debbugs.gnu.org
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Sun, 22 May 2022 13:44:54 -0400
Hello,

daanturo <daanturo <at> gmail.com> writes:
> Emacs is unable to recognize any Super-modified keys. 

My bad, I gave the wrong git hash.  I meant this hash: 1c1ae6ba80. 
If you want to re-enable super modified keys you have to make the 
following change.  If I remember correctly Po Lu thinks this is a 
bug in some other software and that the GDK_SUPER_MASK bit should 
be set so they don't want to add the GDK_MOD4_MASK bit. 
Personally, I think GDK_MOD4_MASK should be added and we should 
just add a todo comment to look into it more later.

I suppose the thought is that in theory someone could use MOD4 as 
a custom modifier instead of using it as super but realistically I 
think someone trying to do that would have lots of problems.  It 
would be cool if that was possible though so I do support trying 
to rid ourselves of odd grandfathered in quirks.


diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 
b9d0b7b512..3ef643a075 100644 --- a/src/pgtkterm.c +++ 
b/src/pgtkterm.c @@ -5018,7 +5018,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; 
@@ -5151,7 +5151,8 @@ 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; 







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53200; Package emacs. (Mon, 23 May 2022 00:56:02 GMT) Full text and rfc822 format available.

Message #30 received at 53200 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Morgan Smith <morgan.j.smith <at> outlook.com>
Cc: 53200 <at> debbugs.gnu.org, daanturo <daanturo <at> gmail.com>
Subject: Re: bug#53200: 29.0.50; C-S-u shortcut fails with 'PGTK' enable
Date: Mon, 23 May 2022 08:55:01 +0800
Morgan Smith <morgan.j.smith <at> outlook.com> writes:

> Hello,
>
> daanturo <daanturo <at> gmail.com> writes:
>> Emacs is unable to recognize any Super-modified keys. 
>
> My bad, I gave the wrong git hash.  I meant this hash: 1c1ae6ba80. If
> you want to re-enable super modified keys you have to make the
> following change.  If I remember correctly Po Lu thinks this is a bug
> in some other software and that the GDK_SUPER_MASK bit should be set
> so they don't want to add the GDK_MOD4_MASK bit. Personally, I think
> GDK_MOD4_MASK should be added and we should just add a todo comment to
> look into it more later.
>
> I suppose the thought is that in theory someone could use MOD4 as a
> custom modifier instead of using it as super but realistically I think
> someone trying to do that would have lots of problems.  It would be
> cool if that was possible though so I do support trying to rid
> ourselves of odd grandfathered in quirks.

No.  It is safe to use Mod4 for something else than Super.  (On X
Windows it is often Hyper, or both at the same time, or else.)

The only modifier that is not safe to change is Mod1, which GTK always
assumes to be alt.

Please let the GTK developers know that the bug is important here:
https://gitlab.gnome.org/GNOME/gtk/-/issues/4913

Otherwise, they will keep ignoring it, as usual.




Merged 49211 53200 55362 55660. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 27 May 2022 05:55:02 GMT) Full text and rfc822 format available.

Forcibly Merged 49211 53200 55362 55660 56653. Request was from Po Lu <luangruo <at> yahoo.com> to control <at> debbugs.gnu.org. (Wed, 20 Jul 2022 11:16:02 GMT) Full text and rfc822 format available.

Forcibly Merged 49211 51002 53200 55362 55660 56653. Request was from Po Lu <luangruo <at> yahoo.com> to control <at> debbugs.gnu.org. (Tue, 13 Sep 2022 02:32:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Nov 2022 12:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Daan Ro <daanturo <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 24 Nov 2022 08:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 Dec 2022 12:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Daan Ro <daanturo <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 25 Dec 2022 08:59:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Jan 2023 12:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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