After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748904 - wayland: map real modifiers to virtual modifiers
wayland: map real modifiers to virtual modifiers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-05-04 16:01 UTC by Marek Chalupa
Modified: 2015-11-15 04:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement bodies of add/map_virtual_modifiers functions (4.06 KB, patch)
2015-05-04 16:01 UTC, Marek Chalupa
none Details | Review
Map real modifiers to virtual for wayland events (3.81 KB, patch)
2015-05-04 16:02 UTC, Marek Chalupa
none Details | Review
wayland: Translate virtual modifiers too (1.67 KB, patch)
2015-11-03 17:51 UTC, Rui Matos
committed Details | Review

Description Marek Chalupa 2015-05-04 16:01:50 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.
Comment 1 Marek Chalupa 2015-05-04 16:02:47 UTC
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
Comment 2 Matthias Clasen 2015-05-11 01:30:35 UTC
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.
Comment 3 Daniel Stone 2015-05-11 17:02:16 UTC
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.
Comment 4 Marek Chalupa 2015-05-14 08:19:54 UTC
(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?
Comment 5 Daniel Stone 2015-05-14 14:37:17 UTC
(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.
Comment 6 Rui Matos 2015-11-03 17:51:13 UTC
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.
Comment 7 Daniel Stone 2015-11-03 21:58:46 UTC
Bug 749643 seems totally unrelated, but this patch looks good to me.
Comment 8 Marek Chalupa 2015-11-04 10:12:04 UTC
I think it should have been bug 748526
Comment 9 Matthias Clasen 2015-11-04 19:35:45 UTC
Review of attachment 314758 [details] [review]:

looks good
Comment 10 Matthias Clasen 2015-11-15 04:27:39 UTC
Attachment 314758 [details] pushed as bc6d2d6 - wayland: Translate virtual modifiers too