GNU bug report logs - #65802
29.1; Emacs fails to recognise Hyper under Wayland (KDE)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Marvin Gülker <post+emacs@HIDDEN>; dated Thu, 7 Sep 2023 13:16:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Sep 2023 13:15:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 07 09:15:22 2023
Received: from localhost ([127.0.0.1]:38863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qeEqt-00041v-3J
	for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:15:22 -0400
Received: from lists.gnu.org ([2001:470:142::17]:47718)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <post+emacs@HIDDEN>) id 1qeElq-0003sm-U2
 for submit <at> debbugs.gnu.org; Thu, 07 Sep 2023 09:10:10 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <post+emacs@HIDDEN>)
 id 1qeEli-0002xb-86
 for bug-gnu-emacs@HIDDEN; Thu, 07 Sep 2023 09:09:59 -0400
Received: from mout-p-202.mailbox.org ([80.241.56.172])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <post+emacs@HIDDEN>)
 id 1qeEld-0001wR-WE
 for bug-gnu-emacs@HIDDEN; Thu, 07 Sep 2023 09:09:57 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org
 [IPv6:2001:67c:2050:b231:465::202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4RhKMm1pztz9sr8
 for <bug-gnu-emacs@HIDDEN>; Thu,  7 Sep 2023 15:09:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guelker.eu; s=MBO0001; 
 t=1694092180;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=nA+Zv/JTE8erfDQg8We1Xdufc2hb/yA1eZwT1VizwqI=;
 b=qNOBJOaWNlMOtsFQ/uRHQMo+rUoL06nRcBFHk3VdASgDyDrVKmRYgR7f0LhmAb/tYO4HSp
 J3UAsd+Qda8A/7AGhI/tIwLZf+mJir0KgEkI6bDpafbcGAVcCWFZypA/AAUUbLQDbFmXwd
 l4EHmD0iRIc9R38UtHGnwRsf8+dbn73XWJe/PdukT9beMYyCtzOnfXLu7D/HLBKJYkOA1K
 /zMR67oYbIhzuuIbLaKqgzROVKI/ma0jWf7kLSxXXus6XDzT5yZIVI8F2HBZ2TAFcQzxJ3
 ciGO2X1Z6LdTmNCEd4a/CL3agGUD8lx0rdHh9SejiUcorDLwhWQ7TF69Itv7EQ==
From: Marvin =?utf-8?Q?G=C3=BClker?= <post+emacs@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.1; Emacs fails to recognise Hyper under Wayland (KDE)
Date: Thu, 07 Sep 2023 15:01:24 +0200
Message-ID: <8734zqp1t8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Rspamd-Queue-Id: 4RhKMm1pztz9sr8
Received-SPF: pass client-ip=80.241.56.172; envelope-from=post+emacs@HIDDEN;
 helo=mout-p-202.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 07 Sep 2023 09:15:18 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Dear developers,

Emacs fails to recognise a Hyper key modifier sent by the Wayland
compositor. I used XKB to make the caps-lock key into the Hyper modifier
key using the method described at
<https://who-t.blogspot.com/2020/02/user-specific-xkb-configuration-part-1.=
html>.
Thus, I now have a file ~/.config/xkb/rules/evdev with this content:

    ! option                =3D       symbols
      custom:hypercaps      =3D       +custom(hypercaps)
=20=20=20=20
    ! include %S/evdev

And ~/.config/xkb/symbols/custom with this content:

    partial alphanumeric_keys
    xkb_symbols "hypercaps" {
        key <CAPS> { [ Hyper_L ] };
        modifier_map Mod3 { <CAPS> };
    };

This creates a new XKB option custom:hypercaps. I run KDE Plasma, so I
enabled this new XKB option by editing ~/.config/kxkbrc so that it
contains this line in the section [Layout]:

    Options=3Dcustom:hypercaps

In case it is relevant, other than this I use a German keyboard layout
(de). Log out and log in again to have the change take effect. After
that, it can be seen in wev(1) that the KDE Wayland compositor emits
Hyper_L and maps it to to Mod3 when the former caps-lock key is pressed:

    [14:     wl_keyboard] key: serial: 4191; time: 829255; key: 66; state: =
1 (pressed)
    sym: Hyper_L      (65517), utf8: ''
    [14:     wl_keyboard] modifiers: serial: 0; group: 0
    depressed: 00000020: Mod3
    latched: 00000000
    locked: 00000000
    [14:     wl_keyboard] key: serial: 4193; time: 829286; key: 66; state: =
0 (released)
    sym: Hyper_L      (65517), utf8: ''
    [14:     wl_keyboard] modifiers: serial: 0; group: 0
    depressed: 00000000
    latched: 00000000
    locked: 00000000

Note how this is different from just setting the XKB option caps:hyper,
which will only make the compositor emit Hyper_L, but does not map that
one to Mod3, but rather to Mod4 (making the key effectively a Super key,
which I do not want -- I use Super to control KWin, the window manager).

Still, emacs -Q entirely fails to recognise the new Hyper key (or more
precisely: the Mod3 modifier). If I press a combination of keys
involving the caps-lock key (=3D Hyper_L), it simply ignores it. For
instance, pressing [CapsLock]+[A] under the above configuration should
result in Emacs signalling "H-a is undefined", but it instead inserts
only "a", revealing that no Hyper modifier is applied.

To reproduce:

1. Create ~/.config/xkb/rules/evdev and ~/.config/xkb/symbols/custom
   with the contents shown above.

2. Edit ~/.config/kxkbrc as shown above.

3. Log out and in again.

4. Launch emacs -Q. Press the caps-lock key and the A key
   simultaneously.

Expected behaviour would be the error message "H-a is undefined". Real
behaviour is the insertion of the character "a".

If I run an Emacs without PGTK enabled (that is, under XWayland) it
properly recognises the new Hyper key.

System Information:

    Operating System: Arch Linux=20
    KDE Plasma Version: 5.27.7
    KDE Frameworks Version: 5.109.0
    Qt Version: 5.15.10
    Kernel Version: 6.4.12-arch1-1 (64-bit)
    Graphics Platform: Wayland
    Processors: 8 =C3=97 Intel=C2=AE Core=E2=84=A2 i5-8350U CPU @ 1.70GHz
    Memory: 15.4 GiB of RAM
    Graphics Processor: Mesa Intel=C2=AE UHD Graphics 620
    Manufacturer: LENOVO
    Product Name: 20L6S29E18
    System Version: ThinkPad T480

In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
cairo version 1.17.8)
System Description: Arch Linux

Configured using:
 'configure --with-pgtk --with-native-compilation=3Daot --sysconfdir=3D/etc
 --prefix=3D/usr --libexecdir=3D/usr/lib --with-tree-sitter
 --localstatedir=3D/var --with-cairo --disable-build-details
 --with-harfbuzz --with-libsystemd --with-modules 'CFLAGS=3D-march=3Dx86-64
 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3D2
 -Wformat -Werror=3Dformat-security -fstack-clash-protection
 -fcf-protection -g
 -ffile-prefix-map=3D/build/emacs/src=3D/usr/src/debug/emacs -flto=3Dauto'
 'LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=3Dauto'
 'CXXFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt -fexceptio=
ns
 -Wp,-D_FORTIFY_SOURCE=3D2 -Wformat -Werror=3Dformat-security
 -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g
 -ffile-prefix-map=3D/build/emacs/src=3D/usr/src/debug/emacs -flto=3Dauto''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: de_DE.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
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
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 nadvice seq
simple cl-generic indonesian philippine 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 abbrev obarray oclosure cl-preloaded button
loaddefs theme-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 dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 76839 6912)
 (symbols 48 7115 0)
 (strings 32 19631 2224)
 (string-bytes 1 574914)
 (vectors 16 15638)
 (vector-slots 8 327224 13701)
 (floats 8 27 46)
 (intervals 56 247 0)
 (buffers 984 11))

--=20
Dipl.-Jur. M. G=C3=BClker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@HIDDEN    | O<




Acknowledgement sent to Marvin Gülker <post+emacs@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#65802; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 7 Sep 2023 13:30:02 UTC

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