From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trey Peacock Newsgroups: gmane.emacs.devel Subject: Re: PGTK-related misconceptions Date: Tue, 19 Apr 2022 03:28:55 +0000 Message-ID: <877d7lrbta.fsf@treypeacock.com> References: <87y202f4dq.fsf@treypeacock.com> <87o80xhor2.fsf@yahoo.com> Reply-To: Trey Peacock Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="------43840bde42200f38fed9c221da51c890badc7c44be74e7adaa78b65ad23b6025"; charset=utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7260"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Morgan Smith , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 19 05:29:55 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ngeYs-0001kg-Rs for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Apr 2022 05:29:55 +0200 Original-Received: from localhost ([::1]:41504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngeYr-0003vc-9S for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Apr 2022 23:29:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngeYA-0003FL-Oq for emacs-devel@gnu.org; Mon, 18 Apr 2022 23:29:11 -0400 Original-Received: from mail-4317.proton.ch ([185.70.43.17]:49417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngeY6-0000Ko-DM for emacs-devel@gnu.org; Mon, 18 Apr 2022 23:29:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=treypeacock.com; s=protonmail2; t=1650338943; bh=eSrXNJaqp4tKIz3DLnjmRqa2Y7PigFSQKyGpXFmUimU=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=Mbx9rA3cHzoKBfW1SBBezo+djeH1fPhXyxO3IahlKor+Di9hUSzu6bDT/C7bthVy0 fnxLcgd8c0OJqwE1BxlnYl89p4l//pfpM/eE9zqxPyNQko2FKBQpYRx6Kjx2SvrJNF r08ggIfKb5h2AZjOyHPMcV6O7dUJPG1dJMFm1shMabB8Nb95pydUGVwNg8czIeQRHc mQ4iC5Z661IpE/kxvAdBhhuDjb61pAUrVnY/3ZL+wcOS1CxvQaU2woKW9WlgST/vr/ E5WFeHMJsAcMCok56ue7aABynJK+yDD3I5lj5otpQuOPY4039sQKJ7kSlc5vb5APRc NF4H+Vyiz/eHw== In-Reply-To: <87o80xhor2.fsf@yahoo.com> Received-SPF: pass client-ip=185.70.43.17; envelope-from=gpg@treypeacock.com; helo=mail-4317.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288643 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------43840bde42200f38fed9c221da51c890badc7c44be74e7adaa78b65ad23b6025 Content-Type: multipart/mixed; boundary=50cf32d607b5b82b181b26759488f6f884cf0e0c455d0624c314bcd44666 From: Trey Peacock To: Po Lu Cc: Morgan Smith , emacs-devel@gnu.org Subject: Re: PGTK-related misconceptions In-Reply-To: <87o80xhor2.fsf@yahoo.com> References: <87y202f4dq.fsf@treypeacock.com> <87o80xhor2.fsf@yahoo.com> Date: Mon, 18 Apr 2022 20:28:49 -0700 Message-ID: <877d7lrbta.fsf@treypeacock.com> MIME-Version: 1.0 --50cf32d607b5b82b181b26759488f6f884cf0e0c455d0624c314bcd44666 Content-Transfer-Encoding: Content-Disposition: Content-Type: text/plain; charset=UTF-8 "Po Lu" writes: > Trey writes: > >> Po Lu writes: >> >>> Morgan Smith writes: >>> >>>> 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. >>> >>> Crystal ball says you are using X Windows, and have to put >>> >>> remove mod4 = Hyper_L >>> >>> in your ~/.Xmodmap file, because GTK doesn't try as hard as regular X11 >>> Emacs to work around the common kind of virtual modifier >>> misconfiguration. >>> >> >> I'm experiencing the same issue here. My super key no longer registers, >> even using emacs -Q. However, I find it begins from the commit changing >> to GDK modifier masks 1c1ae6ba802cc5813fa6f8f90f21050aae6bb459. I've >> tested this with the following specs: >> >> WMs: River & Sway >> Emacs Version: Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version >> 3.24.33, cairo version 1.17.6) of 2022-04-18 > > What about GNOME Shell, which this change was tested on? > > Anyway, if GTK is not setting the GDK_SUPER_MASK on Wayland, it is a bug > in GDK, and should be reported to its developers. Neither of the WMs I mentioned use GNOME Shell, but they do both use wlroots. Looking into this, it seems that any wlroots based Wayland compositor will use GDK_MOD4_MASK as Super. However, mutter (GNOME's WM) uses GDK_SUPER_MASK. Rebuilding emacs with the below patch seems to have fixed the issue. I'm not sure if there could be further implications for pgtk_emacs_to_gtk_modifiers. diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 2b04699fb3..d8ca89bbc0 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -5152,7 +5152,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; @@ -5285,7 +5285,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_HYPER_MASK | GDK_MOD4_MASK))) { if (pgtk_im_filter_keypress (f, &event->key)) return TRUE; --50cf32d607b5b82b181b26759488f6f884cf0e0c455d0624c314bcd44666 Content-Transfer-Encoding: base64 Content-Disposition: attachment; name="publickey - gpg@treypeacock.com - da008078.asc"; filename="publickey - gpg@treypeacock.com - da008078.asc" Content-Type: application/pgp-keys; name="publickey - gpg@treypeacock.com - da008078.asc"; filename="publickey - gpg@treypeacock.com - da008078.asc" LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdvcGVuUEdQIDIu NC4xCkNvbW1lbnQ6IGh0dHBzOi8vZ29wZW5wZ3Aub3JnCgp4ak1FWVRVVCtSWUpLd1lCQkFIYVJ3 OEJBUWRBd2Q1cUwyVkRyREJ4R2RVUnp1T09xZGpraEZjbU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TZlR3MjBXCklRVGFBSUI0cWd0MEZKelMrb1hJNUljQko5UERiWnJZ QVFDeHBTWUlkMkd3WFZzR1lMSFNiMXRnd1cyeUZoRVMKT2lvZXpDYkhmMmhvT1FFQTByMm1XUU1I RXlCaGl3TldUL3VTcFJZa0NJU1dNQzhuUFlDdlo3a3FUUVRPTXdSaApOUlJwRmdrckJnRUVBZHBI RHdFQkIwRHZLRmpFTkRGUy9YSENxVWR6aml6RnFleVVlWjJrLys5K3BQQXpGNnlWCklzSjRCQmdX Q2dBSkJRSmhOVVduQWhzTUFDRUpFTWpraHdFbjA4TnRGaUVFMmdDQWVLb0xkQlNjMHZxRnlPU0gK QVNmVHcyMk1xUUVBMXNEYVovUEVpOGNPUFBMMllWUE5HY2R6MkdyaUY1bEVFVVQ4cU1YNmpKd0Ev Um16VEJNbQpCNTRqcldEZTdjSzJFTEtQM3JtM2JGM0hQZUovMFFWbUxlRUMKPUZhYVEKLS0tLS1F TkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQ== --50cf32d607b5b82b181b26759488f6f884cf0e0c455d0624c314bcd44666-- --------43840bde42200f38fed9c221da51c890badc7c44be74e7adaa78b65ad23b6025 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wnUEARYIACcFAmJeLHUJkNklQYYH3R20FiEE/+Y3+IGuMe5u9qYJ2SVBhgfd HbQAAG4bAQDjE9AXMj+LoqgJgKORGfyjkhiIYkpwC47caDmzih5+uQD/UtJl TonqAJNAIBnLsTFIK6fwCmXt9dtywwIdGSj/0A0= =Yoyd -----END PGP SIGNATURE----- --------43840bde42200f38fed9c221da51c890badc7c44be74e7adaa78b65ad23b6025--