[Top][All Lists]

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

Re: PGTK-related misconceptions

From: Akira Kyle
Subject: Re: PGTK-related misconceptions
Date: Wed, 27 Jul 2022 19:39:19 -0600
User-agent: mu4e 1.6.11; emacs 29.0.50

On Wed, Jul 27, 2022 at 10:48 AM, Po Lu <luangruo@yahoo.com> wrote:

Namely gtk behaves differently in stetting GDK_SUPER_MASK on x11 versus wayland where on the former seeing the "Super_R" symbol will set the mask while on the latter, only the virtual modifier "Super"
will set GDK_SUPER_MASK.

That's because the Wayland compositor isn't sending a keymap that makes libxkbcommon assign Mod4 to Super. See this bit of gdkkeys-wayland.c:

if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Super")))
    state |= GDK_SUPER_MASK;

which is called from deliver_key_event and keyboard_handle_modifiers in

  seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);

and uses an XKB keymap created in _gdk_wayland_keymap_update_from_fd. It is not a bug in GTK, but a bug in the default configuration of the
Wayland compositor (regardless of what their developers say.)

I'm not totally convinced, since sway should just be using the .xkb file I specify. The relevant code is in sway/input/keyboard.c where it uses the .xkb file in sway_keyboard_compile_keymap which then sway sets using wlr_keyboard_set_keymap inside sway_keyboard_configure. So this should be the same keymap that GTK is using.

Perhaps the bug isn't in GTK but its that mutter is doing something special, but I don't immediately see how the function add_virtual_mods in src/wayland/meta-wayland-keyboard.c would cause this bug and I don't see anything else obviously related to this bug.

Although it seems like in principle, one should be able to get xkb to set the "Super" virtual modifier so that GTK correctly picks it up in it's wayland code. However thus far I have been unable to make a set of xkb rules which will trigger the "Super" virtual modifier for the <RWIN> keycode despite much effort. Perhaps this is possible and I just don't understand xkb's rules sufficiently, or perhaps there is some issue in xkb which is preventing from GTK to picking up the "Super" virtual modifier. Thus far I have tried many variations on

Could you please send the entire XKB file generated?  Thanks.


Attachment: dvorak_super_compiled.xkb
Description: Text document

reply via email to

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