GNOME Bugzilla – Bug 771744
Wayland: Switching between Two Finger and Edge scrolling doesn't work
Last modified: 2016-11-28 17:15:22 UTC
As the title says, even when I select Edge Scrolling, it disables Two Finger Scrolling, but still I'm able to use the latter, and not the former. The behaviour persists even across session restarts. Please reassign to the right component. This was tested on GNOME 3.22.0, Wayland session and libinput-1.5.0.
Does this work properly in X11? Which exact version of mutter and gnome-control-center are you using? Might be a problem in mutter's 36cd7177fd40432cb4ae7db10e2571dbbd9604b9, with an ordering problem for 2fg and edge scrolling.
I haven't tried on X11. As said, this is GNOME 3.22.0, so mutter and gnome-control-center are 3.22.0, too.
(In reply to Armin K. from comment #2) > I haven't tried on X11. As said, this is GNOME 3.22.0, so mutter and > gnome-control-center are 3.22.0, too. gnome-control-center 3.22.0 isn't part of the 3.22.0 release: https://mail.gnome.org/archives/desktop-devel-list/2016-September/msg00039.html So this question isn't as unneeded as you might think. I also don't cross-reference bugs. Please let me know if it works as expected on X11.
(In reply to Bastien Nocera from comment #3) > (In reply to Armin K. from comment #2) > > I haven't tried on X11. As said, this is GNOME 3.22.0, so mutter and > > gnome-control-center are 3.22.0, too. > > gnome-control-center 3.22.0 isn't part of the 3.22.0 release: > https://mail.gnome.org/archives/desktop-devel-list/2016-September/msg00039. > html > > So this question isn't as unneeded as you might think. I also don't > cross-reference bugs. Right, my bad. I wasn't aware that GNOME 3.22 was released yet, I just download all the packages as they get available on download.gnome.org, and this package set is all latest packages as of this morning (UTC+2). > > Please let me know if it works as expected on X11. I'll let you know as soon as I'm able to switch sessions.
(In reply to Bastien Nocera from comment #3) > Please let me know if it works as expected on X11. I don't even have touchpad options on X11 in the mouse panel. This is xorg-server-1.18.99.901 and xf86-input-libinput from git (last night).
(In reply to Armin K. from comment #5) > (In reply to Bastien Nocera from comment #3) > > Please let me know if it works as expected on X11. > > I don't even have touchpad options on X11 in the mouse panel. > > This is xorg-server-1.18.99.901 and xf86-input-libinput from git (last > night). This might mean that mutter/gnome-control-center can't detect your touchpad as a touchpad. I'm not sure how it could apply settings at that point then. What's the output of: sudo libinput-list-devices
Created attachment 335996 [details] libinput-list-devices output (In reply to Bastien Nocera from comment #6) > (In reply to Armin K. from comment #5) > > (In reply to Bastien Nocera from comment #3) > > > Please let me know if it works as expected on X11. > > > > I don't even have touchpad options on X11 in the mouse panel. > > > > This is xorg-server-1.18.99.901 and xf86-input-libinput from git (last > > night). > > This might mean that mutter/gnome-control-center can't detect your touchpad > as a touchpad. I'm not sure how it could apply settings at that point then. > > What's the output of: > sudo libinput-list-devices Here you go.
Device: SynPS/2 Synaptics TouchPad Kernel: /dev/input/event7 Group: 7 Seat: seat0, default Size: 97.74x48.75mm Capabilities: pointer Tap-to-click: disabled Tap-and-drag: enabled Tap drag lock: disabled Left-handed: disabled Nat.scrolling: disabled Middle emulation: n/a Calibration: n/a Scroll methods: *two-finger edge Click methods: none Disable-w-typing: enabled Accel profiles: none Rotation: n/a Looks like it should be detected. Did you install the libinput xorg driver as well? Are you sure it's used?
Sep 21 15:27:34 krejzi /usr/libexec/gdm-x-session[32548]: (II) Using input driver 'synaptics' for 'SynPS/2 Synaptics TouchPad' Ugh, no. I suppose xf86-input-libinput preference got lowered in latest git master (it was working just fine few days ago). Checking again with xf86-input-{evdev,synaptics} removed.
Ok, here's what I got on X11: Switching from two-finger scrolling to edge scrolling on the fly doesn't work; I had to restart the session to get Edge Scrolling enabled. Two finger scrolling was properly disabled immediately (but edge scrolling wasn't enabled). Switching from Edge Scrolling to Two Finger scrolling on the fly worked fine. All tests were done in g-c-c mouse panel "Test your settings" area.
I have the same issue on Arch Linux with Gnome 3.22.1 and libinput 1.5.0. I enable edge-scrolling and disable two-fingers scrolling in Gnome-control-center but edge-scrolling doesn't work and two-fingers scrolling is still working. Here my "sudo libinput-list-devices": Device: AlpsPS/2 ALPS GlidePoint Kernel: /dev/input/event11 Group: 7 Seat: seat0, default Size: 71.43x50.00mm Capabilities: pointer Tap-to-click: disabled Tap-and-drag: enabled Tap drag lock: disabled Left-handed: disabled Nat.scrolling: disabled Middle emulation: enabled Calibration: n/a Scroll methods: *two-finger edge Click methods: none Disable-w-typing: enabled Accel profiles: none Rotation: n/a
Created attachment 338631 [details] [review] MetaInputSettingsNative: allow unsetting click and scroll methods Checking for supported methods isn't needed since libinput will just error out and do nothing itself if a requested method isn't supported and, in fact, this logic was preventing the enum values 0 from being set.
Created attachment 338632 [details] [review] MetaInputSettings: fix two finger preference over edge scrolling logic Enabling edge scrolling before disabling two finger would result in edge scrolling not actually being enabled because two finger is still enabled at the time and we bail out. This patch moves this logic to common code for both the native and X backends and fixes it by ensuring that both settings are never set at the same time and still re-checking if edge scrolling should be enabled after two finger scrolling gets disabled. We also simplify the code by not checking for supported/available settings since the underlying devices will just reject those values and there isn't anything we can do about it here. It's the UI's job to only show supported/available settings to users.
Review of attachment 338632 [details] [review]: Untested, but LGTM ::: src/backends/x11/meta-input-settings-x11.c @@ +230,1 @@ goto out; We know there's nothing to free now, so could just use if (!current) return; ... change_property(); meta_XFree (current); @@ +254,1 @@ goto out; Dto.
Review of attachment 338631 [details] [review]: Nice!
That breaks a functionality that I was trying to keep, which is, unless the user opens the Mouse panel, they *can* keep both edge and two-finger scrolling enabled. I'd rather we figured out why the gsettings aren't getting set in the right order. Maybe this fixes it? diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c index 126b762..9063078 100644 --- a/panels/mouse/gnome-mouse-properties.c +++ b/panels/mouse/gnome-mouse-properties.c @@ -142,13 +142,13 @@ edge_scrolling_changed_event (GtkSwitch *button, if (d->changing_scroll) return; - g_settings_set_boolean (d->touchpad_settings, "edge-scrolling-enabled", state); - gtk_switch_set_state (button, state); - if (state && gtk_widget_get_visible (WID ("two-finger-scrolling-row"))) { /* Disable two-finger scrolling if edge scrolling is enabled */ gtk_switch_set_state (GTK_SWITCH (WID ("two-finger-scrolling-switch")), FALSE); } + + g_settings_set_boolean (d->touchpad_settings, "edge-scrolling-enabled", state); + gtk_switch_set_state (button, state); } static gboolean I thought I was careful doing it...
tested under X11 on top of mutter-3.22.1-5.fc25.x86_64, works as expected
doh, collision with Bastien - comment 17 refers to the attachment 338631 [details] [review] and attachment 338632 [details] [review]
(In reply to Bastien Nocera from comment #16) > That breaks a functionality that I was trying to keep, which is, unless the > user opens the Mouse panel, they *can* keep both edge and two-finger > scrolling enabled. AFAIU from libinput's code, setting both scroll methods at the same time doesn't actually work, despite the enum looking like it could because the values can work as a bit field. Peter will surely correct me if I'm wrong :-)
(In reply to Rui Matos from comment #19) > (In reply to Bastien Nocera from comment #16) > > That breaks a functionality that I was trying to keep, which is, unless the > > user opens the Mouse panel, they *can* keep both edge and two-finger > > scrolling enabled. > > AFAIU from libinput's code, setting both scroll methods at the same time > doesn't actually work, despite the enum looking like it could because the > values can work as a bit field. Peter will surely correct me if I'm wrong :-) My memory was playing tricks, but not quick. Yes, one device can only have one of those enabled at a time, but if you had the very corner case of a crappy touchpad internal to your laptop which only supported edge scrolling, and a fancy external touchpad with two-finger scrolling, then we would have both with their own scrolling methods enabled. It's an edge case, I just want to make sure that we know that we're dropping it.
(In reply to Rui Matos from comment #19) > AFAIU from libinput's code, setting both scroll methods at the same time > doesn't actually work, despite the enum looking like it could because the > values can work as a bit field. Peter will surely correct me if I'm wrong :-) yep, that's correct. the reason they're a bitfield is because of scroll_get_methods(), in hindsight it should've been a normal enum and use a "scroll_method_is_supported()" instead. but I can't go back, my time machine is currently broken :) (In reply to Bastien Nocera from comment #20) > My memory was playing tricks, but not quick. Yes, one device can only have > one of those enabled at a time, but if you had the very corner case of a > crappy touchpad internal to your laptop which only supported edge scrolling, > and a fancy external touchpad with two-finger scrolling, then we would have > both with their own scrolling methods enabled. > > It's an edge case, I just want to make sure that we know that we're dropping > it. judging by the bug reports I see external touchpads are already incredibly uncommon, I think there can't be more than 3 users with the above combination out there. Probably cheaper to drop the functionality and buy them a beer in apology instead ;)
(In reply to Peter Hutterer from comment #21) > (In reply to Bastien Nocera from comment #20) > > My memory was playing tricks, but not quick. Yes, one device can only have > > one of those enabled at a time, but if you had the very corner case of a > > crappy touchpad internal to your laptop which only supported edge scrolling, > > and a fancy external touchpad with two-finger scrolling, then we would have > > both with their own scrolling methods enabled. > > > > It's an edge case, I just want to make sure that we know that we're dropping > > it. Ok, I wasn't aware of that. > judging by the bug reports I see external touchpads are already incredibly > uncommon, I think there can't be more than 3 users with the above > combination out there. Probably cheaper to drop the functionality and buy > them a beer in apology instead ;) But, I agree with this. I don't think the added complexity and bug potential is worth it for that kind of use case. Also, in that case, users can still open up Settings and tweak the switches so that it works with the touchpad they're currently using. Or does anyone seriously use both the laptop's touchpad and an external one at the same time? Pushing with the review's comments addressed. Attachment 338631 [details] pushed as fb5e591 - MetaInputSettingsNative: allow unsetting click and scroll methods Attachment 338632 [details] pushed as 2641b36 - MetaInputSettings: fix two finger preference over edge scrolling logic
Confirm same problem. Independently from settings in wayland session only a Two Finger scrolling work. > Does this work properly in X11? yes, in X11 session everything work well > Which exact version of mutter and gnome-control-center are you using? GNOME 3.22.1 gnome-control-center 3.22.1-1 mutter 3.22.1+41+ge8fc090-1
mutter 3.22.2 crashes with X errors (BadValue from XInput) for some users. Reverting 374bba2 (MetaInputSettings: fix two finger preference over edge scrolling logic) fixes it. For details, see https://bugs.archlinux.org/task/51791 . org.gnome.Shell.desktop[728]: X Error of failed request: BadValue (integer parameter out of range for operation) org.gnome.Shell.desktop[728]: Major opcode of failed request: 131 (XInputExtension) org.gnome.Shell.desktop[728]: Minor opcode of failed request: 57 () org.gnome.Shell.desktop[728]: Value in failed request: 0x124 org.gnome.Shell.desktop[728]: Serial number of failed request: 327 org.gnome.Shell.desktop[728]: Current serial number in output stream: 328
Created attachment 339818 [details] [review] meta-input-settings-x11: Don't try setting unavailable scroll methods Since doing so causes BadValue X errors. -- *sigh* the libinput X driver is more zealous than it could be here
Review of attachment 339818 [details] [review]: Grrr, there goes the nice cleanup :-( ::: src/backends/x11/meta-input-settings-x11.c @@ +239,3 @@ + XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS); + if (!available || !available[SCROLL_METHOD_FIELD_EDGE]) + goto out; current is uninitialized when hitting that goto @@ +268,3 @@ + XA_INTEGER, 8, SCROLL_METHOD_NUM_FIELDS); + if (!available || !available[SCROLL_METHOD_FIELD_2FG]) + goto out; Dto.
Created attachment 339825 [details] [review] meta-input-settings-x11: Don't try setting unavailable scroll methods
Review of attachment 339825 [details] [review]: (Untested on my part, but) code looks good to me
(In reply to Rui Matos from comment #25) > *sigh* the libinput X driver is more zealous than it could be here sorry about that. we have to be, the driver only gets to say yes or no to any new property setting but it's the server that maintains the actual property value. so if we weren't to error out here, the property would show values set that aren't actually available/enabled/... in the hardware.
Review of attachment 339825 [details] [review]: A user reported that the fix is good.
Attachment 339825 [details] pushed as 925b1ae - meta-input-settings-x11: Don't try setting unavailable scroll methods
*** Bug 772815 has been marked as a duplicate of this bug. ***