emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PGTK-related misconceptions


From: Trey Peacock
Subject: Re: PGTK-related misconceptions
Date: Wed, 20 Apr 2022 07:52:56 +0000

"Po Lu" <luangruo@yahoo.com> writes:

> Trey Peacock <gpg@treypeacock.com> writes:
>
>>> 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.
>
> It's the documented behavior of GDK, and Emacs holds GDK to its
> documentation.  Nowhere does the documentation say this is a
> "capability", "recognizes" is in the third-person present tense, which
> makes it a requirement.
>
>> 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.
>
> Great, one step forward would be to bring up the issue with either the
> GTK or Wayland compositor developers.  Since you've already talked with
> the latter, and they say it's not their problem, please contact the
> former.
>
>> 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.
>
> It is, as specified in its documentation.
>
>> Your change seems to have removed a fallback in case there were no
>> virtual modifiers and reverses the previous logic:
>
> As you can see by the name of the function, it was directly ported over
> from X (the current version is in xterm.c), and is yet another example
> of the PGTK port translating X Windows code to GDK verbatim, duplicating
> what GDK is supposed to do itself.
>
> I will not change Emacs because the GTK developers, yet again, forgot to
> follow their own documentation when implementing some feature.  It just
> makes Emacs code bloated, hard-to-follow and liable to break at the
> slightest whim of the GTK developers, who then respond that we're not
> using GTK "properly", because we try to work around their problems.

You have already changed Emacs from accepting both MOD4 and SUPER_MASK
as its Super key modifiers to only accepting SUPER_MASK. I imagine this
response is born of more than just this issue but I would not let it
cloud an easy solution.

GTK 3.24.33 still accepts Mod2-5 masks, recognizes them separately from
the virtual modifier masks, and unlike the x11 implementation does not
contain the logic to set convert Super_L or Super_R to GDK_SUPER_MASK.
So what you have done is actually held Emacs to GDK's x11
implementation and documentation rather than looking at the code itself.

https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.33/gdk/wayland/gdkkeys-wayland.c#L249-316
https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.33/gdk/x11/gdkkeys-x11.c#L396-398

If the PGTK branch is meant for "alternative window systems available on
GNU/Linux and some Unix systems, such as Wayland" then I do think there
should be more consideration taken compositors that do not share
Mutter's workaround. Had you been using any other compositor, surely you
would not have made this change. Perhaps even filing a bug yourself.

This will be my last comment on the matter as I don't think its
productive for either of us to belabor our points.

Attachment: publickey - gpg@treypeacock.com - da008078.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]