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 764825 - [WAYLAND] Fn key resets scrolling
[WAYLAND] Fn key resets scrolling
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-09 19:08 UTC by Lionel Landwerlin
Modified: 2016-04-27 13:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Ignore NoSymbol keys (1.75 KB, patch)
2016-04-27 12:11 UTC, Daniel Stone
committed Details | Review

Description Lionel Landwerlin 2016-04-09 19:08:40 UTC
In the terminal on X11 I can scroll up/down with Fn-Shift-Up/Down.
Fn seems to be considered as a modifier key, so it doesn't have any effect on its own. And I can happily press it after having scrolled up, it doesn't have any effect.

On wayland unfortunately, pressing Fn resets the scroll to the bottom.
This is a bit annoying because a number of other keybindings (like cycle through tabs Fn-Ctrl-Left/Right) also use that key.

This might be a Gtk+ bug.
Comment 1 Emmanuele Bassi (:ebassi) 2016-04-09 19:24:03 UTC
I think this is another case of xkb-common being inconsistent on what it actually consumes as a modifier than GDK on X11 (GDK-X11 has its own internal copy of an Xlib function) — see bug 754110.
Comment 2 Daniel Stone 2016-04-12 10:00:57 UTC
(In reply to Emmanuele Bassi (:ebassi) from comment #1)
> I think this is another case of xkb-common being inconsistent on what it
> actually consumes as a modifier than GDK on X11 (GDK-X11 has its own
> internal copy of an Xlib function) — see bug 754110.

Not really; Fn isn't a modifier because it doesn't apply any modifications in an xkbcommon sense. Fn-shifting is performed in the kernel (drivers/hid/hid-apple.c), and we don't do anything with it in userspace. We return a key with zero levels and no information about it, which is pretty accurate. Our gut feeling is that either GTK+ should be suppressing the event if it knows nothing of it, or VTE should be ignoring it.

Discussion: https://github.com/xkbcommon/libxkbcommon/issues/34
Comment 3 Lionel Landwerlin 2016-04-12 10:42:36 UTC
It probably makes more sense to have that in vte.
Comment 4 Christian Persch 2016-04-15 16:13:48 UTC
I see no define for the "Fn" key in gdkkeysyms.h. If there is none, it needs to be added first before I can add it to the list of modifiers that vte checks.
Comment 5 Daniel Stone 2016-04-15 16:22:46 UTC
It is mapped to NoSymbol.
Comment 6 Christian Persch 2016-04-15 16:52:55 UTC
Is there anything else getting mapped to NoSymbol ? Or do you think anything mapped to NoSymbol should get the same treatment as Fn ?
Comment 7 Daniel Stone 2016-04-15 16:54:35 UTC
I'd suggest anything else producing NoSymbol get ignored: by definition, you don't know what it is, so it can produce no useful output.
Comment 8 Christian Persch 2016-04-24 12:05:50 UTC
There's no GDK_KEY_NoSymbol; do you mean GDK_KEY_VoidSymbol maybe?
Comment 9 Daniel Stone 2016-04-27 12:11:48 UTC
Created attachment 326862 [details] [review]
wayland: Ignore NoSymbol keys

NoSymbol is not a valid GDK symbol (it only has the concept of
VoidSymbol, for some reason, which is neither the same thing nor
produced by any sane keymap). Passing NoSymbol events through to GTK+
apps is unlikely to produce anything useful.

In particular, this meant VTE would scroll to the end of the buffer when
pressing Fn (required for Page Up/Down on Macs), as it was receiving a
keypress that wasn't a modifeir. This does not happen on X11, as the
KEY_FN keycode is above 255, so does not get sent to clients.
Comment 10 Daniel Stone 2016-04-27 12:13:35 UTC
OK, turns out this is actually a Wayland-backend bug, as other backends don't appear to transmit NoSymbol keysyms. I've attached the patch, but can't reassign because I don't have privileges.
Comment 11 Emmanuele Bassi (:ebassi) 2016-04-27 12:30:49 UTC
Re-assigning
Comment 12 Emmanuele Bassi (:ebassi) 2016-04-27 12:31:29 UTC
Review of attachment 326862 [details] [review]:

Looks good to me.

Would be good to cherry-pick to gtk-3-20 as well.
Comment 13 Emmanuele Bassi (:ebassi) 2016-04-27 13:07:21 UTC
Attachment 326862 [details] pushed as 210a747 - wayland: Ignore NoSymbol keys