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 746840 - touchpad spontaneously loses ability to use right click button
touchpad spontaneously loses ability to use right click button
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-26 18:24 UTC by Ray Strode [halfline]
Modified: 2015-06-30 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ray Strode [halfline] 2015-03-26 18:24:17 UTC
My logitech wireless touchpad has two hidden mechanical buttons in it (on the bottom corners).

Normally the left corner left clicks and the right corner right clicks.

Spontaneously (for instance when i start hexchat), the right corner starts delivering left click. Once it breaks, it stays broken until I log out.

I did some digging and I eventually found this code:

https://git.gnome.org/browse/mutter/tree/src/backends/x11/meta-input-settings-x11.c?id=3a2920d4bc13fbff6ee8da4de691d258ed6412cd#n202

...
    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
      /* XXX: We can't be much smarter yet, x11 doesn't expose default settings */
    case G_DESKTOP_TOUCHPAD_CLICK_METHOD_FINGERS:
      values[1] = 1;
      break;
...

The CLICK_METHOD_FINGERS disables soft button areas on the touchpad (soft button areas are counter-intuitively required to make the physical buttons work on a logitech device).  CLICK_METHOD_FINGERS is only normally used for macbooks.  In fact, the driver default has this:

        if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)•
→       →       return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;•
→       else•
→       →       return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;•

The comment above says mutter can't be smarter, since there's no way to get the default settings. There is, though, since we just need to query the settings at startup. The current settings at startup time are the defaults. Ideally we should also restore the defaults at shutdown to make sure gnome-shell --replace works properly, but that's bonus points.
Comment 1 Jonas Ådahl 2015-03-27 01:30:07 UTC
(In reply to Ray Strode [halfline] from comment #0)
> My logitech wireless touchpad has two hidden mechanical buttons in it (on
> the bottom corners).
> 
> Normally the left corner left clicks and the right corner right clicks.
> 
> Spontaneously (for instance when i start hexchat), the right corner starts
> delivering left click. Once it breaks, it stays broken until I log out.
> 
> I did some digging and I eventually found this code:
> 
> https://git.gnome.org/browse/mutter/tree/src/backends/x11/meta-input-
> settings-x11.c?id=3a2920d4bc13fbff6ee8da4de691d258ed6412cd#n202
> 
> ...
>     case G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT:
>       /* XXX: We can't be much smarter yet, x11 doesn't expose default
> settings */
>     case G_DESKTOP_TOUCHPAD_CLICK_METHOD_FINGERS:
>       values[1] = 1;
>       break;
> ...

Hmm. I wonder if that default-means-click-fingers (which is the opposite of the default in all PC laptops a, and not supported on touchpads without buttonpads under the touchpad) was deliberate or not.

Anyway, are you saying this code here gets called spontaneously for example when starting hexchat? That sounds a bit odd. Otherwise this sounds like a libinput bug, rather than a bug in mutter.

> 
> The CLICK_METHOD_FINGERS disables soft button areas on the touchpad (soft
> button areas are counter-intuitively required to make the physical buttons
> work on a logitech device).  CLICK_METHOD_FINGERS is only normally used for
> macbooks.  In fact, the driver default has this:

The physical buttons may simply just be one button which uses on the finger position to determine whether a press should be right or left click. This is what BUTTON_AREAS click method does. CLICKFINGER disables the area based detection and counts the number of touching fingers to determine whether a press should be right or left click. Assuming your device is the kind that uses the finger position to determine the type of click, you'd need to use the BUTTON_AREAS method.

> 
>         if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)•
> →       →       return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;•
> →       else•
> →       →       return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;•
> 
> The comment above says mutter can't be smarter, since there's no way to get
> the default settings. There is, though, since we just need to query the
> settings at startup. The current settings at startup time are the defaults.
> Ideally we should also restore the defaults at shutdown to make sure
> gnome-shell --replace works properly, but that's bonus points.
Comment 2 Ray Strode [halfline] 2015-03-27 02:15:57 UTC
(In reply to Jonas Ådahl from comment #1)
> Hmm. I wonder if that default-means-click-fingers (which is the opposite of
> the default in all PC laptops a, and not supported on touchpads without
> buttonpads under the touchpad) was deliberate or not.
I think so, but clearly the right way forward is to just use the X server default for the default setting.

> Anyway, are you saying this code here gets called spontaneously for example
> when starting hexchat? That sounds a bit odd.
Yea, I didn't track down why. The key point is the code doesnt run at login, but only later, so the driver defaults (which are right) get used until the function runs and then the right click button works no more, and I have to right click with two finger touch.

> Otherwise this sounds like a libinput bug, rather than a bug in mutter.
You lost me.  How could this be a libinput bug? libinput is just doing what it's incorrectly being told to do (use CLICK_METHOD_FINGERS)
 
> The physical buttons may simply just be one button which uses on the finger
> position to determine whether a press should be right or left click. This is
> what BUTTON_AREAS click method does.
yup, exactly.

> CLICKFINGER disables the area based
> detection and counts the number of touching fingers to determine whether a
> press should be right or left click.
right, we're on the same page.

> Assuming your device is the kind that
> uses the finger position to determine the type of click, you'd need to use
> the BUTTON_AREAS method.
which the driver correctly picks from the code snippet i pasted:

> > 
> >         if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)•
> > →       →       return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;•
> > →       else•
> > →       →       return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;•

The thing to realize is users will always have click-method set to G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT.  we don't expose that setting in the UI, just gsettings.  So it's a genuine mutter bug that DEFAULT hardcodes CLICKFINGER, instead of, say, using the default queried from the X server at startup
Comment 3 Jonas Ådahl 2015-03-27 02:29:03 UTC
(In reply to Ray Strode [halfline] from comment #2)
> (In reply to Jonas Ådahl from comment #1)
> > Hmm. I wonder if that default-means-click-fingers (which is the opposite of
> > the default in all PC laptops a, and not supported on touchpads without
> > buttonpads under the touchpad) was deliberate or not.
> I think so, but clearly the right way forward is to just use the X server
> default for the default setting.
> 
> > Anyway, are you saying this code here gets called spontaneously for example
> > when starting hexchat? That sounds a bit odd.
> Yea, I didn't track down why. The key point is the code doesnt run at login,
> but only later, so the driver defaults (which are right) get used until the
> function runs and then the right click button works no more, and I have to
> right click with two finger touch.

Sounds like two bugs then: one that the configuration is applied at login, and the other that "default" incorrectly overrides the default configuration.

> 
> > Otherwise this sounds like a libinput bug, rather than a bug in mutter.
> You lost me.  How could this be a libinput bug? libinput is just doing what
> it's incorrectly being told to do (use CLICK_METHOD_FINGERS)

I meant that if this code was *not* run at the time the issue happened, it'd be a bug in libinput, but if the reason is the spontaneous configuration then its not a bug in libinput.

>  
> > The physical buttons may simply just be one button which uses on the finger
> > position to determine whether a press should be right or left click. This is
> > what BUTTON_AREAS click method does.
> yup, exactly.
> 
> > CLICKFINGER disables the area based
> > detection and counts the number of touching fingers to determine whether a
> > press should be right or left click.
> right, we're on the same page.
> 
> > Assuming your device is the kind that
> > uses the finger position to determine the type of click, you'd need to use
> > the BUTTON_AREAS method.
> which the driver correctly picks from the code snippet i pasted:
> 
> > > 
> > >         if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)•
> > > →       →       return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;•
> > > →       else•
> > > →       →       return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;•
> 
> The thing to realize is users will always have click-method set to
> G_DESKTOP_TOUCHPAD_CLICK_METHOD_DEFAULT.  we don't expose that setting in
> the UI, just gsettings.  So it's a genuine mutter bug that DEFAULT hardcodes
> CLICKFINGER, instead of, say, using the default queried from the X server at
> startup
Comment 4 Jonas Ådahl 2015-03-27 02:30:14 UTC
(In reply to Jonas Ådahl from comment #3)
> (In reply to Ray Strode [halfline] from comment #2)
> > (In reply to Jonas Ådahl from comment #1)
> > > Hmm. I wonder if that default-means-click-fingers (which is the opposite of
> > > the default in all PC laptops a, and not supported on touchpads without
> > > buttonpads under the touchpad) was deliberate or not.
> > I think so, but clearly the right way forward is to just use the X server
> > default for the default setting.
> > 
> > > Anyway, are you saying this code here gets called spontaneously for example
> > > when starting hexchat? That sounds a bit odd.
> > Yea, I didn't track down why. The key point is the code doesnt run at login,
> > but only later, so the driver defaults (which are right) get used until the
> > function runs and then the right click button works no more, and I have to
> > right click with two finger touch.
> 
> Sounds like two bugs then: one that the configuration is applied at login,
> and the other that "default" incorrectly overrides the default configuration.

Err, meant *not* applied at login.
Comment 5 Ray Strode [halfline] 2015-03-27 11:52:56 UTC
Hi,

> Sounds like two bugs then: one that the configuration is applied at login,
> and the other that "default" incorrectly overrides the default configuration.
yea

> I meant that if this code was *not* run at the time the issue happened, it'd
> be a bug in libinput, but if the reason is the spontaneous configuration
> then its not a bug in libinput.
Ah, I see what you were saying now.
Comment 6 Jan Alexander Steffens (heftig) 2015-04-09 08:28:30 UTC
Indeed, the setting isn't applied at login. My touchpad defaults to button-areas, but I want clickfinger since my touchpad is smooth. On X11 I can alter the default via Xorg config, but on Wayland I need to depend on mutter to do this.
Comment 7 Peter Hutterer 2015-04-23 04:55:25 UTC
xf86-input-libinput exports the "libinput something Default" properties now to get the default from libinput at runtime.

http://cgit.freedesktop.org/xorg/driver/xf86-input-libinput/commit/?id=8d4e03570cbdbb53bae57452614cbe45b6eb46f8

sorry about the delay, i released 0.9.0 today so that should make its way through the distros soonish.
Comment 8 Rui Matos 2015-05-05 18:47:55 UTC
Isn't this fixed in 3.16.1 ?
Comment 9 Ray Strode [halfline] 2015-05-05 19:48:33 UTC
i don't believe so.
Comment 10 Rui Matos 2015-05-06 14:08:47 UTC
So this bug is just about that

/* XXX: We can't be much smarter yet, x11 doesn't expose default settings */

case? In that case it will be fixed shortly.

But there seems to be some more talk here about settings not being applied at login, which should be fixed in 3.16.1 already.
Comment 11 Ray Strode [halfline] 2015-05-06 16:30:54 UTC
yup, cool.
Comment 12 Jasper St. Pierre (not reading bugmail) 2015-06-27 03:57:28 UTC
Has there been any update here?
Comment 14 Jasper St. Pierre (not reading bugmail) 2015-06-28 22:51:27 UTC
I thought I saw a fix go by, thanks.
Comment 15 Ray Strode [halfline] 2015-06-29 13:41:23 UTC
Though, I believe this gives us the libinput default not the Xorg default (which might be different because of xorg.conf changes), so (I think?) some users will still end up in a situation where their config may spontaneously change.
Comment 16 Ray Strode [halfline] 2015-06-29 13:42:05 UTC
Peter, does xf86-input-libinput factor in xorg.conf changes when figuring out what to set the property to?
Comment 17 Peter Hutterer 2015-06-29 22:04:48 UTC
no, that was a conscious decision we made when adding the Default property to reset it to HW defaults (well, libinput defaults). see 

https://bugs.freedesktop.org/show_bug.cgi?id=89574

I guess the argument here is that if GNOME overrides the configuration anyway, changes should be made there rather than stacking configuration methods.
Comment 18 Ray Strode [halfline] 2015-06-30 13:20:24 UTC
So comment 15 was wrong about "spontaneously changes" since I believe we do apply the setting at login time now. 

Still, I think the argument mentioned in comment 17 is wrong.  Why would we ignore xorg.conf ? We don't for other settings. 

Peter are you okay with changing it?  Bastien are you okay with it getting changed?
Comment 19 Bastien Nocera 2015-06-30 13:22:18 UTC
(In reply to Ray Strode [halfline] from comment #18)
> So comment 15 was wrong about "spontaneously changes" since I believe we do
> apply the setting at login time now. 
> 
> Still, I think the argument mentioned in comment 17 is wrong.  Why would we
> ignore xorg.conf ? We don't for other settings. 

We do ignore it for plenty of settings, where we overwrite them. It also wouldn't work with Wayland.
Comment 20 Ray Strode [halfline] 2015-06-30 13:30:49 UTC
i'm not going to argue too strongly since it ultimately won't matter in a wayland future, but I can't think of a good reason to override. there's no pro's and obvious cons
Comment 21 Jasper St. Pierre (not reading bugmail) 2015-06-30 17:27:06 UTC
If xorg.conf and gsettings disagree, which do we pick? There's also no way to tell what the xorg.conf setting is, or whether it was set by a conf file.
Comment 22 Ray Strode [halfline] 2015-06-30 17:40:39 UTC
(In reply to Jasper St. Pierre from comment #21)
> If xorg.conf and gsettings disagree, which do we pick?
gsettings of course.  This whole bug is about what to do when gsettings is set to the "use the system default" setting.

> There's also no way to tell what the xorg.conf setting is, or whether it was set by a conf file.
There are two distinct, and viable ways identified in this very report:

 - read the value at start up.  (see last two sentences of comment 0),
 - updating the property provided by xf86-input-libinput to account for the xorg.conf (which it's already reading after all). Note that property was added for this bug.  

It's not a question of "can't", it's a question of "didn't, but why?" (see comment 17).  Anyway, already had a debate about this on IRC. bottom line is it doesn't really matter. it's a corner case, and that corner case will be gone in a year anyway when we've all jumped on the wayland train.