From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marvin =?UTF-8?Q?G=C3=BClker?= Newsgroups: gmane.emacs.bugs Subject: bug#65802: 29.1; Emacs fails to recognise Hyper under Wayland (KDE) Date: Thu, 07 Sep 2023 15:01:24 +0200 Message-ID: <8734zqp1t8.fsf@guelker.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21321"; mail-complaints-to="usenet@ciao.gmane.io" To: 65802@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 07 15:16:09 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qeErh-0005Im-3M for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Sep 2023 15:16:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeEre-0008Cn-Po; Thu, 07 Sep 2023 09:16:06 -0400 Original-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 ) id 1qeErZ-0007tr-3c for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 09:16:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeErY-00057O-EZ for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 09:16:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeEra-00042y-1s for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 09:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marvin =?UTF-8?Q?G=C3=BClker?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Sep 2023 13:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65802 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169409252215503 (code B ref -1); Thu, 07 Sep 2023 13:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2023 13:15:22 +0000 Original-Received: from localhost ([127.0.0.1]:38863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeEqt-00041v-3J for submit@debbugs.gnu.org; Thu, 07 Sep 2023 09:15:22 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:47718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeElq-0003sm-U2 for submit@debbugs.gnu.org; Thu, 07 Sep 2023 09:10:10 -0400 Original-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 ) id 1qeEli-0002xb-86 for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 09:09:59 -0400 Original-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 ) id 1qeEld-0001wR-WE for bug-gnu-emacs@gnu.org; Thu, 07 Sep 2023 09:09:57 -0400 Original-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 ; 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== X-Rspamd-Queue-Id: 4RhKMm1pztz9sr8 Received-SPF: pass client-ip=80.241.56.172; envelope-from=post+emacs@guelker.eu; 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-Mailman-Approved-At: Thu, 07 Sep 2023 09:15:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269651 Archived-At: 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 . 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 { [ Hyper_L ] }; modifier_map Mod3 { }; }; 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@guelker.eu | O<