GNOME Bugzilla – Bug 748904
wayland: map real modifiers to virtual modifiers
Last modified: 2015-11-15 04:27:42 UTC
Created attachment 302872 [details] [review] Implement bodies of add/map_virtual_modifiers functions Wayland compositors send only real modifiers and it looks like it won't change for a while. Attached patches implement the translation similarly as we do in X11 backend. This is a part of a fix of the bug https://bugzilla.gnome.org/show_bug.cgi?id=748526 P. S. These patches are written for 3.16 branch but apply smoothly to master too.
Created attachment 302876 [details] [review] Map real modifiers to virtual for wayland events Fixes https://bugzilla.gnome.org/show_bug.cgi?id=748526 for g-c-c under wayland
I think this should really be fixed by having compositors send a full set of modifiers. The only reason for the real/virtual mapping mess in xkb is X event size limitations and similar historical reasons.
We're looking at solving this differently within xkbcommon, by drawing a distinction between 'primary' and 'secondary' modifiers, where secondary/contributary modifiers are those like RCtrl that should be ignored when doing lookups. But, that being said, we do already send all modifiers which should be used for doing lookups.
(In reply to Daniel Stone from comment #3) > We're looking at solving this differently within xkbcommon, by drawing a > distinction between 'primary' and 'secondary' modifiers, where > secondary/contributary modifiers are those like RCtrl that should be ignored > when doing lookups. But, that being said, we do already send all modifiers > which should be used for doing lookups. So if I understand it correctly that means that clients are now getting everything they need and should lookup the mappings themselves?
(In reply to Marek Chalupa from comment #4) > (In reply to Daniel Stone from comment #3) > > We're looking at solving this differently within xkbcommon, by drawing a > > distinction between 'primary' and 'secondary' modifiers, where > > secondary/contributary modifiers are those like RCtrl that should be ignored > > when doing lookups. But, that being said, we do already send all modifiers > > which should be used for doing lookups. > > So if I understand it correctly that means that clients are now getting > everything they need and should lookup the mappings themselves? Yep - if that's not the case, please let us know so we can fix xkbcommon.
Created attachment 314758 [details] [review] wayland: Translate virtual modifiers too Wayland allows us to receive virtual modifiers too so we can just use them directly if the compositor does send them. -- This and the patches in bug 749643 implements the suggestion here (IIUC) of sending virtual modifiers from the compositor.
Bug 749643 seems totally unrelated, but this patch looks good to me.
I think it should have been bug 748526
Review of attachment 314758 [details] [review]: looks good
Attachment 314758 [details] pushed as bc6d2d6 - wayland: Translate virtual modifiers too