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: Wed, 20 Apr 2022 02:33:14 +0000 Message-ID: <87mtgga3h6.fsf@treypeacock.com> References: <87y202f4dq.fsf@treypeacock.com> <87o80xhor2.fsf@yahoo.com> <877d7lrbta.fsf@treypeacock.com> <87mtghg0j6.fsf@yahoo.com> <87pmlcad91.fsf@treypeacock.com> <875yn4eg0w.fsf@yahoo.com> Reply-To: Trey Peacock Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="------27084edaa53e7add14df28da846b7d8f9e9932f8739c8e00b6adbeda461ab0dd"; charset=utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36150"; 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 Wed Apr 20 04:34:47 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 1nh0B4-0009Bu-Mh for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Apr 2022 04:34:47 +0200 Original-Received: from localhost ([::1]:58358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nh0B3-00053M-Lq for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Apr 2022 22:34:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh09q-0003LZ-5G for emacs-devel@gnu.org; Tue, 19 Apr 2022 22:33:30 -0400 Original-Received: from mail-4317.proton.ch ([185.70.43.17]:35973) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh09m-0001DE-FS for emacs-devel@gnu.org; Tue, 19 Apr 2022 22:33:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=treypeacock.com; s=protonmail2; t=1650422002; bh=gacdcQ9rxrrelxWXrxzoneL1TihbjwkXes5fX8iZvWk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=rJTnjYMzGCqzukpwlv5BsuMTKi+zZRLWnCL/AKqGnoXSd6qGeZGiwGOjqVX4N4fnu V5I8GxsR8C7joW+c0sCgXiZa+EJzTgHvk4JkyXgjll9wLpNd6vv4faoJZmNVFO0jRP vH7xyQ2NVPWyWQ0khSQiNQ6R/yqKxCnKOKYdG0VmkNsey1jYl61mGgO+TZoslBqkz+ rBU9hr745Z0cnHVpQMo/Q4wA5mUN88EzH1UTIhnni1dtQXSRj6cavP66o6DGmYX+hn HWOCekd2tug2X+jTb7qi9KDgiDKsKlVsAuZ1T9n17J38v/i6mDjggg77nfx/zeavTq 6R2CFKbDUFPfA== In-Reply-To: <875yn4eg0w.fsf@yahoo.com> Feedback-ID: 17020329:user:proton 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:288686 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------27084edaa53e7add14df28da846b7d8f9e9932f8739c8e00b6adbeda461ab0dd Content-Type: multipart/mixed; boundary=2c10194b773e639da8898281508d592b991f16e039aaf1f7e4f2f7e6a2d6 From: Trey Peacock To: Po Lu Cc: Morgan Smith , emacs-devel@gnu.org Subject: Re: PGTK-related misconceptions In-Reply-To: <875yn4eg0w.fsf@yahoo.com> References: <87y202f4dq.fsf@treypeacock.com> <87o80xhor2.fsf@yahoo.com> <877d7lrbta.fsf@treypeacock.com> <87mtghg0j6.fsf@yahoo.com> <87pmlcad91.fsf@treypeacock.com> <875yn4eg0w.fsf@yahoo.com> Date: Tue, 19 Apr 2022 19:33:09 -0700 Message-ID: <87mtgga3h6.fsf@treypeacock.com> MIME-Version: 1.0 --2c10194b773e639da8898281508d592b991f16e039aaf1f7e4f2f7e6a2d6 Content-Transfer-Encoding: Content-Disposition: Content-Type: text/plain; charset=UTF-8 "Po Lu" writes: > Trey Peacock writes: > >> It does not seem to be a requirement of GTK 3.2 or XKB to send virtual >> modifiers. > > See https://docs.gtk.org/gdk3/flags.ModifierType.html, which says: > > Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are > mapped to Mod2 - Mod5, and indicates this by setting GDK_SUPER_MASK, > GDK_HYPER_MASK or GDK_META_MASK in the state field of key events. The capability to do something is not the same as a requirement. >> The only compositor I have come across that actually sends a virtual >> modifier is mutter/GNOME. Neither wlroots nor Weston, the Wayland >> reference implementation, send them. I'm unsure about Plasma, but I >> believe this highlights an issue with the development of pgtk, if it >> is meant to be targeted towards wayland users it should be tested >> against more than just one compositor. > > I don't have any other compositor installed that I can actually start. > Users, such as you, are supposed to do that part of the job. I would be happy to help. Granted, this is only my second interaction on the mailing list, but I do want to contribute how I can. >> The experience of a user updating Emacs and realizing a key is no longer >> recognized, without any notification or justification would also be a >> step backwards. > > That is the price you pay when using the development version of Emacs. > The key wasn't intentionally disabled, so I cannot know those problems > exist until users like you report them. > > Hopefully, those problems will no longer exist when Emacs 29.1 is > released. 100% agree about the risks and responsibilities of users of dev versions. That's why I wanted to bring this to attention. >> I have spoken with devs of wlroots & wayland over IRC and they seem to >> agree that it is not necessary. I don't mean to be adversarial but would >> be happy to see this change amended to incorporate the entirety of >> wayland compositors. > > Wayland compositors do not send those virtual modifier masks. GDK is > supposed to, and does it correctly when running on GNOME Shell, so the > bug either lies in GTK or the other Wayland compositors. The reason this works is because mutter sends additional virtual modifiers. You can see more here: https://gitlab.gnome.org/GNOME/mutter/-/commit/0fa9751b3144aef5faaca1ad381b6f86b5f30994. It is not GDK that is responsible for this. Further, since this is not required, I don't think its proper to deem it a bug. Now, if we were building this against Gtk 4 then I would agree with you it seems to be the direction it's going. Though still not fully explicit. https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/migrating-3to4.md#adapt-to-changes-in-keyboard-modifier-handling. Your change seems to have removed a fallback in case there were no virtual modifiers and reverses the previous logic: previously: if a virtual modifier exists equal to GDK_SUPER_MASK then super_mod_mask = GDK_MOD4_MASK, if it does not equal GDK_SUPER_MASK then it just passes the state & current value. Lastly, if a virtual modifier does not exist super_mod_mask=GDK_MOD4_MASK. current: only if a virtual modifier exists does super_mod_mask = GDK_SUPER_MASK. x_find_modifier_meanings (struct pgtk_display_info *dpyinfo) {... - state = GDK_SUPER_MASK; - r = gdk_keymap_map_virtual_modifiers (keymap, &state); - if (r) - { - /* Super key exists. */ - if (state == GDK_SUPER_MASK) - { - dpyinfo->super_mod_mask = GDK_MOD4_MASK; /* maybe this is super. */ - } - else - { - dpyinfo->super_mod_mask = state & ~GDK_SUPER_MASK; - } - } - else - { - dpyinfo->super_mod_mask = GDK_MOD4_MASK; - } ... } ... pgtk_gtk_to_emacs_modifiers (struct pgtk_display_info *dpyinfo, int state) {... - if (state & dpyinfo->super_mod_mask) + if (state & GDK_SUPER_MASK) mod |= mod_super; ... } --2c10194b773e639da8898281508d592b991f16e039aaf1f7e4f2f7e6a2d6 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 OEJBUWRBd2Q1cUwyVkRyREJ4R2RVUnp1T09xZGpraEZjbU9VUUhrdkxRClU5Q2EvZ1BOS1dkd1ow QjBjbVY1Y0dWaFkyOWpheTVqYjIwZ1BHZHdaMEIwY21WNWNHVmhZMjlqYXk1amIyMCsKd284RUVC WUtBQ0FGQW1FMVJhY0dDd2tIQ0FNQ0JCVUlDZ0lFRmdJQkFBSVpBUUliQXdJZUFRQWhDUkRJNUlj QgpKOVBEYlJZaEJOb0FnSGlxQzNRVW5OTDZoY2praHdFbjA4TnRtUndBL2o2ZWZFRzAvUmU5Z2ln UFVCWm5KZ0NCCm5DSU1JVzhGd2hDL04rMVQ1OVVZQVA0L0tMcGhWSVh3Zzh5TUpRYTM1aWZzendS TncvakpPQjRXcjFienlaMHEKQXM0ekJHRTFGQzRXQ1NzR0FRUUIya2NQQVFFSFFLVzE1Q093WWMw bE9zR2hCWE1IR3drcWNLRHoraHhCZ0ZiWgprSFAwQzVGMHdzQXZCQmdXQ2dBSkJRSmhOVVduQWhz Q0F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LS0tLS1F TkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQ== --2c10194b773e639da8898281508d592b991f16e039aaf1f7e4f2f7e6a2d6-- --------27084edaa53e7add14df28da846b7d8f9e9932f8739c8e00b6adbeda461ab0dd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wnUEARYIACcFAmJfcOgJkNklQYYH3R20FiEE/+Y3+IGuMe5u9qYJ2SVBhgfd HbQAAEdiAQD18EpzuS3xHoC2fWDaj7z9UKlNmrQGGJAGNF7YHijg+AD/ZhPf 9QmHCGkTeG6FNW3jEzkzNPLxQ6oLnCp4Ies7nQE= =SFIn -----END PGP SIGNATURE----- --------27084edaa53e7add14df28da846b7d8f9e9932f8739c8e00b6adbeda461ab0dd--