From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Tropin Newsgroups: gmane.emacs.bugs Subject: bug#57825: 29.0.50; Superkey handling regression in pgtk Date: Mon, 19 Sep 2022 11:15:12 +0300 Message-ID: <87sfknhjan.fsf@trop.in> References: <87v8pp6msk.fsf@trop.in> <87o7vgyjyy.fsf@yahoo.com> <87mtb0q71l.fsf@trop.in> <87k063x401.fsf@yahoo.com> <87y1uggdmp.fsf@trop.in> <87r107zvnb.fsf@gnus.org> <8735cnsuad.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10246"; mail-complaints-to="usenet@ciao.gmane.io" Cc: masmer4@yahoo.co.jp, 57825@debbugs.gnu.org To: Po Lu , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 19 10:44:49 2022 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 1oaCOT-0002Kg-Th for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 10:44:46 +0200 Original-Received: from localhost ([::1]:53758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaCOS-0003O5-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 04:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaBwj-0004R1-7Y for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 04:16:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaBwh-0000MY-5f for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 04:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaBwg-000899-Ug for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 04:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Sep 2022 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57825 X-GNU-PR-Package: emacs Original-Received: via spool by 57825-submit@debbugs.gnu.org id=B57825.166357533031245 (code B ref 57825); Mon, 19 Sep 2022 08:16:02 +0000 Original-Received: (at 57825) by debbugs.gnu.org; 19 Sep 2022 08:15:30 +0000 Original-Received: from localhost ([127.0.0.1]:52272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBwA-00087s-0M for submit@debbugs.gnu.org; Mon, 19 Sep 2022 04:15:30 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:58319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBw5-00087Q-R1 for 57825@debbugs.gnu.org; Mon, 19 Sep 2022 04:15:26 -0400 Original-Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id CADA3240007; Mon, 19 Sep 2022 08:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1663575319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s6tSwBSqN0wdzss27mtlttRKY/gvW+isQH235CZJ/Hw=; b=pOGhfDilUO3rQvs9p5ytEoecLcUmqIgsVPzoBpEy2TeTNpyBHC9YtmWuUOs23Pw+J01E5o kzx0iqLPDKYX9oC1NQudtWKVknjO8SWjXaW8Q1J4XfpyAR8X6WQG3yLH5GWuQNZ/Xtr+xN E1AlQE30Kq2hWQIFTBurdsrScdH0uR1QpJWUzsmYNED+9ceu5s9d611R7r8mJPwmZtXr5I g24JNJYCG20BmsabxyGopUs6UYHmRyRZipagcM7UAqozT/LpvI6TNE3TTrBG/Yxd3flyd8 EoCpRWsiqWuym4X5js6CQ22FjV9FvgqALSB3qvSYPeXMxOsrcrsUTMH9IRzelA== In-Reply-To: <8735cnsuad.fsf@yahoo.com> 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" Xref: news.gmane.io gmane.emacs.bugs:243053 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-09-19 15:22, Po Lu wrote: > Lars Ingebrigtsen writes: > >> Andrew Tropin writes: >> >>> and applied this workaround: >>> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D77e768ac4e57d5f= d443c7d69a7cc0c8339d0c238 >>> >>> the logic in the code is not completely correct, but should work for >>> most users and use cases, we will remove it, once the problem is fixed >>> in GTK and gtk package is updated. >> >> For future reference, I've included the patch below. >> >> Perhaps we should apply something like this to Emacs? >> >> diff --git a/gnu/packages/patches/emacs-pgtk-super-key-fix.patch b/gnu/p= ackages/patches/emacs-pgtk-super-key-fix.patch >> new file mode 100644 >> index 0000000..a58c448 >> --- /dev/null >> +++ b/gnu/packages/patches/emacs-pgtk-super-key-fix.patch >> @@ -0,0 +1,49 @@ >> +From a897516fc5ec380938115ad42023f279d128fc1e Mon Sep 17 00:00:00 2001 >> +From: Andrew Tropin >> +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=3D55362 >> +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 |=3D mod_ctrl; >> + if (state & GDK_META_MASK || state & GDK_MOD1_MASK) >> + mod |=3D mod_meta; >> +- if (state & GDK_SUPER_MASK) >> ++ if (state & GDK_SUPER_MASK || state & GDK_MOD4_MASK) >> + mod |=3D mod_super; >> + if (state & GDK_HYPER_MASK) >> + mod |=3D mod_hyper; >> +@@ -5184,7 +5184,7 @@ key_press_event (GtkWidget *widget, GdkEvent *eve= nt, 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_H= YPER_MASK))) >> + { >> + if (pgtk_im_filter_keypress (f, &event->key)) >> + return TRUE; >> +@@ -5199,8 +5199,9 @@ key_press_event (GtkWidget *widget, GdkEvent *eve= nt, gpointer *user_data) >> + /* make_lispy_event turns chars into control chars. >> + Don't do it here because XLookupString is too eager. */ >> + state &=3D ~GDK_CONTROL_MASK; >> +- state &=3D ~(GDK_META_MASK >> +- | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_MOD1_MASK); >> ++ state &=3D ~(GDK_META_MASK | GDK_MOD1_MASK >> ++ | GDK_SUPER_MASK | GDK_MOD4_MASK >> ++ | GDK_HYPER_MASK); >> +=20 >> + nbytes =3D event->key.length; >> + if (nbytes > copy_bufsiz) >> +--=20 >> +2.37.3 > > No, because this will break on other Wayland compositors, including one > that I am writing. Can you share a link to it, please? Just curious. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmMoJRAACgkQIgjSCVjB 3rBGMBAAg2p/yXr5OkZlAyMOSzghEVEq4HndtQWSkJVM69wxLD6hLe66K5w4fBwP p083T7PFye7Ccsg7yBiQvb2cLUQTbTE2U0hkdecW9wCcoh9m0nxXy5LOk8u3RHrT bGw2IJYzE8P7LS9TEUllHsg9jQ5dDVqU8q4gtbGCwVht7KyYOE7xCZIG4qvsseIQ HCvmZtP7z3aLJati2X+TWRyLdt5JWONoWamXj5UdTaYsT/eVTCVk12cvQlskNg7o vVFkiZjzn8WJxQPWENsikEAxwttH4h/yOlkNoUBSifp4PUvPNK0eq7Ruh00OOcUT JgFYYo1D6s9GdmDZ4+umEvuTtu3Pkiyb1yvDmAtmcjEJTk+8DlAUsPN0TvLn5HN/ yqQMnqIq2MH3XRMFDGIvcoZAaFHsZeScvDpUfHxwLA+PlmKXCwWnp2SNS/2J2gVV TDFQtnA3yMdEdr8GQo0ca1FbAG41WQhh80CEsczHg6Dfrbh9Ea1y2Vvi64eyFCd1 mvEV2Nd8htlz8S7YSBUYoJ8KkG+T+nNo/S3OGtN+xLZAdhV2wrbiI+tO9TIg5J6x kU7QpjS0ma7UqmgXBaNj8HmNs8eQBa5DNRksVpBAxY/BvykC/iX7YN1Z6oEg/X2B 4FFWjHIv3lKE0rR9RyuP7pwEKsPj21dhCRDkrk3meOgmQ0S8QDE= =XYXB -----END PGP SIGNATURE----- --=-=-=--