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 771744 - Wayland: Switching between Two Finger and Edge scrolling doesn't work
Wayland: Switching between Two Finger and Edge scrolling doesn't work
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 772815 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-09-20 21:38 UTC by Armin K.
Modified: 2016-11-28 17:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libinput-list-devices output (4.24 KB, text/plain)
2016-09-21 13:35 UTC, Armin K.
  Details
MetaInputSettingsNative: allow unsetting click and scroll methods (1.94 KB, patch)
2016-10-27 17:37 UTC, Rui Matos
committed Details | Review
MetaInputSettings: fix two finger preference over edge scrolling logic (10.21 KB, patch)
2016-10-27 17:37 UTC, Rui Matos
committed Details | Review
meta-input-settings-x11: Don't try setting unavailable scroll methods (2.61 KB, patch)
2016-11-14 16:38 UTC, Rui Matos
none Details | Review
meta-input-settings-x11: Don't try setting unavailable scroll methods (2.87 KB, patch)
2016-11-14 18:20 UTC, Rui Matos
committed Details | Review

Description Armin K. 2016-09-20 21:38:44 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.
Comment 1 Bastien Nocera 2016-09-21 12:45:35 UTC
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.
Comment 2 Armin K. 2016-09-21 12:48:27 UTC
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.
Comment 3 Bastien Nocera 2016-09-21 13:12:03 UTC
(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.
Comment 4 Armin K. 2016-09-21 13:14:06 UTC
(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.
Comment 5 Armin K. 2016-09-21 13:29:19 UTC
(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).
Comment 6 Bastien Nocera 2016-09-21 13:31:56 UTC
(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
Comment 7 Armin K. 2016-09-21 13:35:02 UTC
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.
Comment 8 Bastien Nocera 2016-09-21 13:42:06 UTC
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?
Comment 9 Armin K. 2016-09-21 13:44:52 UTC
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.
Comment 10 Armin K. 2016-09-21 13:53:37 UTC
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.
Comment 11 baikalink 2016-10-12 18:28:12 UTC
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
Comment 12 Rui Matos 2016-10-27 17:37:07 UTC
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.
Comment 13 Rui Matos 2016-10-27 17:37:45 UTC
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.
Comment 14 Florian Müllner 2016-10-27 22:12:36 UTC
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.
Comment 15 Florian Müllner 2016-10-27 22:12:40 UTC
Review of attachment 338631 [details] [review]:

Nice!
Comment 16 Bastien Nocera 2016-10-28 00:05:03 UTC
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...
Comment 17 Peter Hutterer 2016-10-28 00:22:06 UTC
tested under X11 on top of mutter-3.22.1-5.fc25.x86_64, works as expected
Comment 18 Peter Hutterer 2016-10-28 00:22:52 UTC
doh, collision with Bastien - comment 17 refers to the attachment 338631 [details] [review] and attachment 338632 [details] [review]
Comment 19 Rui Matos 2016-10-31 17:22:23 UTC
(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 :-)
Comment 20 Bastien Nocera 2016-10-31 19:07:23 UTC
(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.
Comment 21 Peter Hutterer 2016-10-31 21:58:22 UTC
(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 ;)
Comment 22 Rui Matos 2016-11-02 13:23:52 UTC
(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
Comment 23 Roman Tataurov 2016-11-02 13:49:21 UTC
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
Comment 24 Jan Alexander Steffens (heftig) 2016-11-14 14:38:12 UTC
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
Comment 25 Rui Matos 2016-11-14 16:38:32 UTC
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
Comment 26 Florian Müllner 2016-11-14 17:03:19 UTC
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.
Comment 27 Rui Matos 2016-11-14 18:20:50 UTC
Created attachment 339825 [details] [review]
meta-input-settings-x11: Don't try setting unavailable scroll methods
Comment 28 Florian Müllner 2016-11-14 19:15:59 UTC
Review of attachment 339825 [details] [review]:

(Untested on my part, but) code looks good to me
Comment 29 Peter Hutterer 2016-11-14 21:56:24 UTC
(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.
Comment 30 Jan Alexander Steffens (heftig) 2016-11-15 20:13:11 UTC
Review of attachment 339825 [details] [review]:

A user reported that the fix is good.
Comment 31 Rui Matos 2016-11-16 12:58:32 UTC
Attachment 339825 [details] pushed as 925b1ae - meta-input-settings-x11: Don't try setting unavailable scroll methods
Comment 32 Bastien Nocera 2016-11-28 17:15:22 UTC
*** Bug 772815 has been marked as a duplicate of this bug. ***