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 764852 - Create configuration option for dwt (disable while typing)
Create configuration option for dwt (disable while typing)
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: mutter-maint
mutter-maint
: 777494 781989 782859 783454 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-04-10 16:28 UTC by Ruben De Smet
Modified: 2017-06-06 08:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
My proposal (37.42 KB, image/png)
2016-04-10 16:28 UTC, Ruben De Smet
  Details
gsettings-desktop-schemas: patch [1/1] (1.34 KB, patch)
2016-04-10 18:49 UTC, Ruben De Smet
needs-work Details | Review
Adds the dwt control to gnome-control-center (9.04 KB, patch)
2016-04-11 09:46 UTC, Ruben De Smet
rejected Details | Review
Adds the dwt libinput and x11 control to mutter (7.64 KB, patch)
2016-04-11 09:48 UTC, Ruben De Smet
needs-work Details | Review
schemas: Add "Disable while typing" touchpad setting (1.47 KB, patch)
2016-12-09 15:45 UTC, Bastien Nocera
committed Details | Review
Adds disable while typing to mutter for x11 and wayland. (8.09 KB, patch)
2017-05-13 17:05 UTC, Evan Welsh
none Details | Review
Patch for disable while typing in mutter, fixed coding style. (8.18 KB, patch)
2017-05-22 21:38 UTC, Evan Welsh
none Details | Review
Implements disable-while-typing in mutter. (8.19 KB, patch)
2017-05-23 13:38 UTC, Evan Welsh
committed Details | Review

Description Ruben De Smet 2016-04-10 16:28:06 UTC
Created attachment 325672 [details]
My proposal

Since a while, libinput enables `dwt` by default. This is very annoying for playing games (especially first person stuff) you have to move the mouse and press keys at the same time.

I suggest a "Disable while Typing" configuration option in gnome-control-settings, see attached screenshot. I'm working on that, I have already altered the gschema.

Will post patches as soon as this starts to work.
Comment 1 Ruben De Smet 2016-04-10 18:49:40 UTC
Created attachment 325677 [details] [review]
gsettings-desktop-schemas: patch [1/1]

Add's the dwt-enabled setting in gconf.
Comment 2 Bastien Nocera 2016-04-10 19:02:10 UTC
(In reply to Ruben De Smet from comment #0)
> Created attachment 325672 [details]
> My proposal
> 
> Since a while, libinput enables `dwt` by default. This is very annoying for
> playing games (especially first person stuff) you have to move the mouse and
> press keys at the same time.

Moving a *mouse* shouldn't disable the keyboard. Is your mouse detected as a touchpad or something?
Comment 3 Bastien Nocera 2016-04-10 19:02:43 UTC
Review of attachment 325677 [details] [review]:

We don't add configuration options to work-around bugs, sorry.
Comment 4 Ruben De Smet 2016-04-10 19:06:49 UTC
(In reply to Bastien Nocera from comment #2)
> (In reply to Ruben De Smet from comment #0)
> > Created attachment 325672 [details]
> > My proposal
> > 
> > Since a while, libinput enables `dwt` by default. This is very annoying for
> > playing games (especially first person stuff) you have to move the mouse and
> > press keys at the same time.
> 
> Moving a *mouse* shouldn't disable the keyboard. Is your mouse detected as a
> touchpad or something?

Sorry, I meant to say *touchpad*, not *mouse*. Since a while, libinput enables `dwt` by default for *all* touchpads, and you cannot disable this.
Comment 5 Ruben De Smet 2016-04-11 08:22:37 UTC
A simple question for someone with knowledge on this topic: in what gnome project should the question get reflected?

I currently have this:

- gsettings-desktop-schemas contains the correct boolean for the dwt option
- gnome-control-center contains the switch that is reflected in gsettings

I thought the next step was to implement the correct libinput calls in gnome-settings-daemon, but apparently (correct me if I am wrong), there's only some schema stuff in gnome-settings-daemon, and now I have no clue where to bind on the gconf setting and put it into libinput.

How does this work, exactly?
Comment 6 Ruben De Smet 2016-04-11 09:42:34 UTC
I found it, it's in mutter and I wrote the necessary code. Patches incoming...
Comment 7 Ruben De Smet 2016-04-11 09:46:20 UTC
Created attachment 325710 [details] [review]
Adds the dwt control to gnome-control-center

This patch sets the setting as described in patch 325677.
Comment 8 Ruben De Smet 2016-04-11 09:48:28 UTC
Created attachment 325711 [details] [review]
Adds the dwt libinput and x11 control to mutter

This patch lets mutter listen to the dwt-enabled setting and sends the correct events the correct touchpad via libinput or the X11 libinput setting.
Comment 9 Bastien Nocera 2016-04-11 10:28:37 UTC
Peter, can we support this use case without adding more configuration options?
Comment 10 Ruben De Smet 2016-04-11 11:29:59 UTC
As an aside: I thought of two other options:

1.
- Design a standard communication protocol (freedesktop) to configure libinput via dbus (?) and get that implemented in GNOME (and KDE, and other DE's and WM's/compositors)
- create a command line program that talks to GNOME and the other compositors via dbus to configure these settings

2.
Have games and other programs requiring touchpad and keyboard interaction at the same time send a signal to gnome/other DE's (possibly via the same protocol as in 1.)

I think that, on the long run, we need both 1. (at least the standard protocol) and 2. (via that dbus protocol) implemented on top of a manual configuration option, albeit for convenience for end-users playing games.

Of course, I'm very open to other suggestions I didn't think of.
Comment 11 Peter Hutterer 2016-04-11 21:10:23 UTC
(In reply to Bastien Nocera from comment #9)
> Peter, can we support this use case without adding more configuration
> options?

I haven't found a way. We're trying to only enable it for built-in touchpads and built-in keyboards but beyond that it's a guess what the current use-case is. libinput has that dwt option because we could not do palm detection reliably, on most touchpads we deal with a palm touch looks identical to a finger touch.

I'm all ears for suggestions though, I hate having to expose this option.
Comment 12 Ruben De Smet 2016-04-12 12:26:02 UTC
The current use case is indeed a laptop with built-in keyboard and touchpad. Some of those people prefer the touchpad to an external mouse and a subset of those use their touchpad and keyboard at the same time.
Comment 13 Bastien Nocera 2016-04-12 15:46:01 UTC
(In reply to Ruben De Smet from comment #12)
> The current use case is indeed a laptop with built-in keyboard and touchpad.
> Some of those people prefer the touchpad to an external mouse and a subset
> of those use their touchpad and keyboard at the same time.

If gnome-shell (via mutter) automatically disabled "disable-while-typing" when there's a fullscreen window (eg. a game) would that be good enough?

We already have a number of special cases for fullscreen applications like games in gnome-shell, so I think that not having a separate option would be preferable.
Comment 14 Ruben De Smet 2016-04-12 19:45:17 UTC
That would only solve part of the problem; some people (like me) play games or use Blender in windowed mode.

But that would do something already indeed.

Another suggestion: use everything I wrote, except for the gnome-control-center part (so mutter and gsettings-desktop-schemas), so that an extension can change the configuration option (like caffeine) or you can edit it manually in gconf. Would that be something? That would expose the option, but it's hidden away for power users.

Then you can also add the game thing you mentioned, for some smoother use cases and non power users.
Comment 15 Peter Hutterer 2016-04-12 21:01:01 UTC
(In reply to Ruben De Smet from comment #14)
> That would only solve part of the problem; some people (like me) play games
> or use Blender in windowed mode.

I think this is the crux of the matter here. Without some communication with the app, you can't know if "hold X while pointer events happen" is a bug or not. Someone who's typing in an editor may do that and require dwt, someone who's typing in blender merely triggers a shortcut and doesn't require dwt.

In libinput, it's impossible to tell anyway but I think you'll find it extremely hard even within gnome shell. now, we *could* introduce some sort of protocol for apps to disable it on the fly or so, but I don't think it will cover the main required use-cases well enough and you'll end up with a need for some global option anyway.
Comment 16 Bastien Nocera 2016-04-13 09:42:06 UTC
Filed bug 764986 for the 95%-no configuration case.
Comment 17 Bastien Nocera 2016-04-13 09:45:43 UTC
Review of attachment 325677 [details] [review]:

The commit message needs work as well.

::: schemas/org.gnome.desktop.peripherals.gschema.xml.in
@@ +14,3 @@
       <description>When disabled, touchpads that only support edge scrolling (and not 2-finger scrolling) will have that feature disabled.</description>
     </key>
+    <key name="dwt-enabled" type="b">

I don't like the shortened name.

@@ +16,3 @@
+    <key name="dwt-enabled" type="b">
+      <default>true</default>
+      <summary>Whether disable while typing is enabled</summary>

Please write "disable while typing" or disable-while-typing, so we understand that it's the name of the option.

@@ +17,3 @@
+      <default>true</default>
+      <summary>Whether disable while typing is enabled</summary>
+      <description>When enabled, touchpads that support disable while typing will disable the touchpad while typing.</description>

Ditto.
Comment 18 Bastien Nocera 2016-04-13 09:46:09 UTC
Review of attachment 325710 [details] [review]:

I don't want this in the Settings, at least for now.
Comment 19 Bastien Nocera 2016-04-13 09:47:07 UTC
Review of attachment 325711 [details] [review]:

Again with "dwt".
Comment 20 Bastien Nocera 2016-04-13 09:50:00 UTC
Review of attachment 325677 [details] [review]:

Note that the original setting is called "disable-while-typing" and was in gnome-settings-daemon.

Look in data/org.gnome.settings-daemon.peripherals.gschema.xml.in.in to find better descriptions.
Comment 21 Ruben De Smet 2016-04-13 11:11:09 UTC
Roger that, I'll have a look this evening (GMT+1).
Comment 22 Wouter Wijsman 2016-06-16 12:56:56 UTC
The control center in Gnome 3.16 had a "Disable while typing" checkbox in it. What changed which makes it no longer a good idea to have this option?
Comment 23 Bastien Nocera 2016-06-16 13:05:19 UTC
(In reply to wwijsman from comment #22)
> The control center in Gnome 3.16 had a "Disable while typing" checkbox in
> it. What changed which makes it no longer a good idea to have this option?

We started using libinput, which implements "disable while typing" in such a way that it doesn't need to be configured.
Comment 24 lemurni42 2016-09-13 02:34:06 UTC
Having dwt as an option (at least via gsettings) is vital indeed, for the use cases mentioned like fps games (e.g. minetest) or working in blender. As Gnome drops synaptics support, people should not have to resort to Windows for games for such reasons...
Comment 25 Bastien Nocera 2016-12-09 15:45:33 UTC
Created attachment 341683 [details] [review]
schemas: Add "Disable while typing" touchpad setting

Disable-while-typing is useful for the majority of cases, except for a
select few applications that require using both touchpad and keyboard,
such as games, and creativity applications which require pressing keys
and moving the cursor.
Comment 26 Bastien Nocera 2016-12-09 15:46:34 UTC
Attachment 341683 [details] pushed as 4c5b1c1 - schemas: Add "Disable while typing" touchpad setting
Comment 27 Bastien Nocera 2016-12-09 15:50:17 UTC
Reassigning to mutter to actually implement the setting.
Comment 28 Florian Müllner 2017-01-19 14:43:19 UTC
*** Bug 777494 has been marked as a duplicate of this bug. ***
Comment 29 Florian Müllner 2017-05-02 12:49:50 UTC
*** Bug 781989 has been marked as a duplicate of this bug. ***
Comment 30 Daniele 2017-05-02 13:10:00 UTC
Why not put a simple flags in settings->mouse?
And leave the user free to enable it, same as a click on the touchpad?

I think I need to uninstall gnome/wayland for another couple of years.
Comment 31 Evan Welsh 2017-05-13 17:05:26 UTC
Created attachment 351785 [details] [review]
Adds disable while typing to mutter for x11 and wayland.

This attachment addresses all previous issues with prior patches and fixes a few prior mistakes. It follows all implementation patterns of similar properties in mutter.
Comment 32 Jonas Ådahl 2017-05-22 14:26:16 UTC
Review of attachment 351785 [details] [review]:

The commit message should be formatted so that lines are not too long (i.e. try to make them not longer than 72 chars).

Anyway, except from that and minor nits, this looks good to me. Want to update the patch or want me to amend the whitespace changes before pushing?

::: src/backends/native/meta-input-settings-native.c
@@ +136,3 @@
+  if (libinput_device_config_dwt_is_available (libinput_device))
+    libinput_device_config_dwt_set_enabled (libinput_device, 
+                                            enabled ? LIBINPUT_CONFIG_DWT_ENABLED : LIBINPUT_CONFIG_DWT_DISABLED);

For coding style consistency with other places that does the same thing (see .._set_tap_enabled()), this should be:

    libinput_device_config_dwt_set_enabled (libinput_device, 
                                            enabled ?
                                            LIBINPUT_CONFIG_DWT_ENABLED :
                                            LIBINPUT_CONFIG_DWT_DISABLED);

::: src/backends/x11/meta-input-settings-x11.c
@@ +212,3 @@
+{
+  guchar value = (enabled) ? 1 : 0;
+

We can actually test the availability of dwt via xf86-input-libinput (by checking the existance of the "Default" property), but that can be added later.
Comment 33 Rui Matos 2017-05-22 15:42:12 UTC
*** Bug 782859 has been marked as a duplicate of this bug. ***
Comment 34 Evan Welsh 2017-05-22 21:38:51 UTC
Created attachment 352383 [details] [review]
Patch for disable while typing in mutter, fixed coding style.

I added the style fix you asked for! Everything else is fairly close to 72 characters but I emphasized fitting the current code style and readability over trying to get each line to 72. As far as I can tell all my additions should match current style.

The reason I avoided the check in x11 is because change_property already detects if a property doesn't exist, Mutter only checks for availability explicitly if it is a setting that has multiple options (3 fingers, 4 fingers, etc.) from what I can see (look at tap_enabled for an example), and if by checking the default value you mean finding the value of 'default' and then checking if its truthy... that fails on systems on systems with a false default. If you mean checking that the property itself actually exists, as mentioned in my first point I'm fairly certain that change_property already checks that... so wouldn't that be a redundant check? I might be wrong on this, I'm no Mutter expert. Thank you so much for your time! If I didn't get the whitespace right please append a commit to fix it as you like. :)
Comment 35 Jonas Ådahl 2017-05-23 00:50:02 UTC
(In reply to Evan Welsh from comment #34)
> Created attachment 352383 [details] [review] [review]
> Patch for disable while typing in mutter, fixed coding style.
> 
> I added the style fix you asked for! Everything else is fairly close to 72
> characters but I emphasized fitting the current code style and readability
> over trying to get each line to 72. As far as I can tell all my additions
> should match current style.

Actually the 72 char limit is about the commit message. Code has soft limit on 80 that is often not respected when it'd awkward to respect.
Comment 36 Evan Welsh 2017-05-23 13:38:33 UTC
Created attachment 352427 [details] [review]
Implements disable-while-typing in mutter.

I misread your previous comment. I've reformatted the commit message so it fits into a 72 character line limit. Sorry about that!
Comment 37 lastweakness 2017-05-24 03:24:07 UTC
Is there any workaround for stable (3.24) users on Wayland?
Comment 38 Jonas Ådahl 2017-05-24 03:33:16 UTC
Review of attachment 352427 [details] [review]:

lgtm.
Comment 39 Jonas Ådahl 2017-05-24 03:38:45 UTC
(In reply to lastweakness from comment #37)
> Is there any workaround for stable (3.24) users on Wayland?

There is no work-around. With that said, it'll be part of the next 3.24.* release.
Comment 40 lastweakness 2017-05-24 03:40:02 UTC
(In reply to Jonas Ådahl from comment #39)
> (In reply to lastweakness from comment #37)
> > Is there any workaround for stable (3.24) users on Wayland?
> 
> There is no work-around. With that said, it'll be part of the next 3.24.*
> release.

Oh. Thanks. Guess i'll wait.
Comment 41 Jonas Ådahl 2017-05-24 03:56:07 UTC
Comment on attachment 352427 [details] [review]
Implements disable-while-typing in mutter.

Attachment 352427 [details] pushed as 28b2add - Implements disable-while-typing in mutter.
Comment 42 Jonas Ådahl 2017-05-24 03:58:28 UTC
Pushed to both gnome-3-24 and master, after fixing some whitespace issues (mostly trailing whitespaces not visible in the bugzilla review tool).
Comment 43 André Klapper 2017-06-06 08:38:59 UTC
*** Bug 783454 has been marked as a duplicate of this bug. ***