Skip to content

Commit

Permalink
Add patch to add "Disable while Typing" to touchpad settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Dec 30, 2020
1 parent a5fb146 commit f81993f
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
@@ -0,0 +1,116 @@
From 7e32832b684e2545a86b02635a93f2fe7b639759 Mon Sep 17 00:00:00 2001
From: Ian Douglas Scott <idscott@system76.com>
Date: Wed, 30 Dec 2020 08:38:44 -0800
Subject: [PATCH] mouse: Add "Disable While Typing" toggle for touchpad

https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/125

As mentioned there, this is exposed in Gnome Tweaks. It is on by
default, but completely break touchpad usage of certain kinds of games
and other software requiring simultaneous use of the mouse and keyboard.

I like the idea in the issue of automatically detecting games, but I'm
not sure how/if it can be done reliably (and it's not an issue only for
games). In lieu of that, it seems good to expose the setting here.
---
panels/mouse/cc-mouse-panel.c | 6 ++++
panels/mouse/cc-mouse-panel.ui | 52 ++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)

diff --git a/panels/mouse/cc-mouse-panel.c b/panels/mouse/cc-mouse-panel.c
index a7f018bc4..880504f03 100644
--- a/panels/mouse/cc-mouse-panel.c
+++ b/panels/mouse/cc-mouse-panel.c
@@ -36,6 +36,7 @@ struct _CcMousePanel
{
CcPanel parent_instance;

+ GtkSwitch *disable_while_typing_switch;
GtkListBoxRow *edge_scrolling_row;
GtkSwitch *edge_scrolling_switch;
GtkListBox *general_listbox;
@@ -301,6 +302,10 @@ setup_dialog (CcMousePanel *self)
self->edge_scrolling_switch, "state",
G_SETTINGS_BIND_GET);

+ g_settings_bind (self->touchpad_settings, "disable-while-typing",
+ self->disable_while_typing_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
setup_touchpad_options (self);
}

@@ -420,6 +425,7 @@ cc_mouse_panel_class_init (CcMousePanelClass *klass)

gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/mouse/cc-mouse-panel.ui");

+ gtk_widget_class_bind_template_child (widget_class, CcMousePanel, disable_while_typing_switch);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, edge_scrolling_row);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, edge_scrolling_switch);
gtk_widget_class_bind_template_child (widget_class, CcMousePanel, general_listbox);
diff --git a/panels/mouse/cc-mouse-panel.ui b/panels/mouse/cc-mouse-panel.ui
index bcfde6de6..747b0f354 100644
--- a/panels/mouse/cc-mouse-panel.ui
+++ b/panels/mouse/cc-mouse-panel.ui
@@ -692,6 +692,58 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="activatable">false</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">32</property>
+ <property name="margin_start">20</property>
+ <property name="margin_end">20</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="xalign">0</property>
+ <property name="valign">end</property>
+ <property name="label" translatable="yes">Disable while typing</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">disable_while_typing_switch</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="disable_while_typing_switch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">center</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
--
2.27.0

1 change: 1 addition & 0 deletions debian/patches/series
Expand Up @@ -50,3 +50,4 @@ Revert-user-accounts-Use-custom-setting-to-override-.patch
# 0001-Revert-Monitor-NMClient-permissions-for-change.patch
# 0001-Revert-sharing-Remove-vino-preferences.patch
# 0002-Revert-sharing-Replace-vino-with-gnome-remote-deskto.patch
0001-mouse-Add-Disable-While-Typing-toggle-for-touchpad.patch

0 comments on commit f81993f

Please sign in to comment.