From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#57825: 29.0.50; Superkey handling regression in pgtk Date: Mon, 19 Sep 2022 09:11:04 +0200 Message-ID: <87r107zvnb.fsf@gnus.org> References: <87v8pp6msk.fsf@trop.in> <87o7vgyjyy.fsf@yahoo.com> <87mtb0q71l.fsf@trop.in> <87k063x401.fsf@yahoo.com> <87y1uggdmp.fsf@trop.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="805"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Po Lu , masmer4@yahoo.co.jp, 57825@debbugs.gnu.org To: Andrew Tropin Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 19 09:12:46 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 1oaAxS-000AdI-AZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 09:12:46 +0200 Original-Received: from localhost ([::1]:57548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaAxR-00036k-Cr for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 03:12:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaAwk-00030A-O2 for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:12:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaAwk-0006nO-DP for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaAwk-0004DI-86 for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Sep 2022 07:12: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.166357147516129 (code B ref 57825); Mon, 19 Sep 2022 07:12:02 +0000 Original-Received: (at 57825) by debbugs.gnu.org; 19 Sep 2022 07:11:15 +0000 Original-Received: from localhost ([127.0.0.1]:52099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaAvy-0004C5-DM for submit@debbugs.gnu.org; Mon, 19 Sep 2022 03:11:14 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:46944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaAvx-0004Bp-ID for 57825@debbugs.gnu.org; Mon, 19 Sep 2022 03:11:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bv+tKAQ9AovOXc2wflzaRI3zGXurVEd7c3Gazj9Q5NQ=; b=IzvlOIYwG5RUiY2U88noUZlX1i 5go3WuxUGbyJBoV/a/Oy6/1OuVvgPSnqLrGzxrwp6Yc3X/E5n0TD/KYpE3P8rIUZkCQzp+e40Hq0s ei7CNnc5xrNceElhTbXWOHznhojyGj3pg6aS0U8rfEudyTziQkPFw8F2ON7TqVbbQYd0=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaAvo-0006cV-I7; Mon, 19 Sep 2022 09:11:07 +0200 In-Reply-To: <87y1uggdmp.fsf@trop.in> (Andrew Tropin's message of "Mon, 19 Sep 2022 08:02:54 +0300") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX83Lr94cKsqadv QmL///9urP2wAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YJEwcJFfolgRgAAAGBSURBVDjLdZSNlYQw CISDNgCxAQMNeKT/3m7Ij/HcPd7qc+eTZEKIKX0P+lD4PzBC3iMIL8AzvQn8PQOAFpDxSIkoMfGt UbuUJQkxRY6I3M6yUtNZSKSDHsePIvaiXZe5JD7cVLOplRuEQ6LdzVxN68pow3FRAH8BTrRBQgZC JmhVoN2KqSPgema0ZeyqVr1atTVUENorwuNWnnYpHXXGI6O5wvuRcPwFmigMmRb2k9MNckUNMa+i XvlUXwBvV9eqXnTD4wIeXq0C6Wm2wFYsEvCrmOcJrvBkbUCU5p6DMZJDgoY1ut92uXq2tnKN+7Xs 1hp6Y0gpiRaY4ftVC62Vj5etlly2ZzPki+HzzGdsBi6a+0GjZ6TrA7R2xY3ogRoIcfxdMZohvUHb b8ZBWBLz3QxoY/mIBehzjgAphn3yfohEsA3oN/XZ0z0DK8Dubmc0xCOD4ih9nbz561VZvttB/OJ2 zNErFK6iNiny0l2NKCVczC/EOPZzZ+j9ZRAaAk/wC8i0SPbmcZflAAAAJXRFWHRkYXRlOmNyZWF0 ZQAyMDIyLTA5LTE5VDA3OjA5OjIwKzAwOjAwZRHd3QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0w OS0xOVQwNzowOToyMCswMDowMBRMZWEAAAAASUVORK5CYII= X-Now-Playing: DMX Krew's _Sound of the Street_: "Dance to the Beat" 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:243033 Archived-At: Andrew Tropin writes: > and applied this workaround: > https://git.savannah.gnu.org/cgit/guix.git/commit/?id=77e768ac4e57d5fd443c7d69a7cc0c8339d0c238 > > 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/packages/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=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