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 768245 - backends: Re-add support for edge scrolling with some touchpads
backends: Re-add support for edge scrolling with some touchpads
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 760814 765619 768071 (view as bug list)
Depends on: 768244
Blocks: 761461
 
 
Reported: 2016-06-30 12:36 UTC by Bastien Nocera
Modified: 2017-01-18 09:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backends: Re-add support for edge scrolling with some touchpads (11.81 KB, patch)
2016-06-30 12:36 UTC, Bastien Nocera
none Details | Review
backends: Re-add support for edge scrolling with some touchpads (11.53 KB, patch)
2016-07-27 11:47 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-06-30 12:36:52 UTC
.
Comment 1 Bastien Nocera 2016-06-30 12:36:57 UTC
Created attachment 330653 [details] [review]
backends: Re-add support for edge scrolling with some touchpads

Add support for setting edge-scrolling separately from two-finger
scrolling. We now have 2 separate boolean settings for those, with the
Mouse panel in gnome-control-center allowing to set only one of those at
a time, but nothing precludes both being set in the configuration.

We need to handle:
- two-finger-scrolling-enabled and edge-scrolling-enabled settings both
  being set.
- those 2 settings being change out-of-order
- two-finger-scrolling being set on a device that doesn't support it
- edge-scrolling-enabled on a device that doesn't support it

And the combinations of one touchpad supporting just one of edge
scrolling and two-finger scrolling and another vice-versa.
Comment 2 Florian Müllner 2016-06-30 12:38:31 UTC
*** Bug 768071 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2016-06-30 13:46:21 UTC
Review of attachment 330653 [details] [review]:

::: configure.ac
@@ +67,1 @@
    $CLUTTER_PACKAGE >= 1.25.6

Looks like you haven't pulled in a while :-)

::: src/backends/native/meta-input-settings-native.c
@@ +170,3 @@
+  /* Don't set edge scrolling if two-finger scrolling is enabled and available */
+  if (current & LIBINPUT_CONFIG_SCROLL_2FG &&
+      supported & LIBINPUT_CONFIG_SCROLL_2FG)

I double checked with Carlos, and:
 - get_method() will return a single value from the enum
 - set_method() will only be successful if the requested
   method is supported

So the following should be equivalent:
  if (current == LIBINPUT_CONFIG_SCROLL_2FG)
    return;

@@ +205,3 @@
+
+  if (two_finger_scroll_enabled &&
+      supported & LIBINPUT_CONFIG_SCROLL_2FG)

There's already an early return if 2fg scrolling is enabled but not supported, so this condition can be reduced to two_finger_scroll_enabled, no?

@@ +209,3 @@
+      scroll_method = LIBINPUT_CONFIG_SCROLL_2FG;
+    }
+  else if (!(current & LIBINPUT_CONFIG_SCROLL_EDGE))

or current != ...

::: src/backends/x11/meta-input-settings-x11.c
@@ +210,3 @@
   available = get_property (device, "libinput Scroll Methods Available",
                             XA_INTEGER, 8, 3);
+  defaults = get_property (device, "libinput Scroll Methods Enable",

Is this correct? I'm only seeing "libinput Scroll Method Enabled" in list-props ...

@@ +223,3 @@
     }
+
+  change_property (device, "libinput Scroll Method Enabled",

If the above is a typo and this is the same property that we retrieve in defaults, this call could be moved into the above if block
Comment 4 Bastien Nocera 2016-07-27 11:47:59 UTC
Created attachment 332211 [details] [review]
backends: Re-add support for edge scrolling with some touchpads

Add support for setting edge-scrolling separately from two-finger
scrolling. We now have 2 separate boolean settings for those, with the
Mouse panel in gnome-control-center allowing to set only one of those at
a time, but nothing precludes both being set in the configuration.

We need to handle:
- two-finger-scrolling-enabled and edge-scrolling-enabled settings both
  being set.
- those 2 settings being change out-of-order
- two-finger-scrolling being set on a device that doesn't support it
- edge-scrolling-enabled on a device that doesn't support it

And the combinations of one touchpad supporting just one of edge
scrolling and two-finger scrolling and another vice-versa.
Comment 5 Florian Müllner 2016-07-27 14:42:36 UTC
Review of attachment 332211 [details] [review]:

LGTM now, though I'd like Carlos to double-check before pushing.
Comment 6 Carlos Garnacho 2016-07-27 14:48:23 UTC
Review of attachment 332211 [details] [review]:

Looks good! I still find kinda unfortunate that edge/2fg scroll are separate settings, but there seems to be a clear precedence between those. I won't let that hold this patch.

::: src/backends/x11/meta-input-settings-x11.c
@@ +237,3 @@
+                                               gboolean                      two_finger_scroll_enabled)
+{
+  guchar values[3] = { 0 }; /* 2fg, edge, button. The last value is unused */

Now that we have this in a couple of places, IMO would be great to have an enum so reading/settings values becomes more readable. Can be done in a later commit though.
Comment 7 Bastien Nocera 2016-07-27 15:29:48 UTC
Attachment 332211 [details] pushed as 36cd717 - backends: Re-add support for edge scrolling with some touchpads
Comment 8 Sebastian Keller 2016-07-27 18:13:29 UTC
*** Bug 760814 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Reiter (lazka) 2016-07-30 08:23:22 UTC
*** Bug 765619 has been marked as a duplicate of this bug. ***