summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2019-03-28 17:10:52 +0100
committerOlivier Fourdan <ofourdan@redhat.com>2019-06-11 12:13:01 +0000
commit9d5e1d9c0f7b0b702372c47fb81fad7cf3a4085f (patch)
treed2f2f9bfa7706d8b10a4b62bf011994da6fae824
parent48085f6d3321e5bb71651f48098d68d172c142d0 (diff)
downloadgnome-settings-daemon-9d5e1d9c0f7b0b702372c47fb81fad7cf3a4085f.tar.gz
mouse: Remove mousetweaks support
The pointer accessibility features handled by "mousetweaks" cannot work on Wayland, so they need to migrate in the Wayland compositor instead. Remove support for "mousetweaks" from gnome-settings daemon. https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/95 https://gitlab.gnome.org/GNOME/mutter/merge_requests/512 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/474
-rw-r--r--plugins/mouse/gsd-mouse-manager.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 1148fa95..ee266003 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -37,20 +37,13 @@
#define GSETTINGS_MOUSE_SCHEMA "org.gnome.desktop.peripherals.mouse"
#define GSETTINGS_TOUCHPAD_SCHEMA "org.gnome.desktop.peripherals.touchpad"
-/* Mouse settings */
-#define KEY_DWELL_CLICK_ENABLED "dwell-click-enabled"
-#define KEY_SECONDARY_CLICK_ENABLED "secondary-click-enabled"
-
struct _GsdMouseManager
{
GObject parent;
- guint start_idle_id;
GSettings *touchpad_settings;
- GSettings *mouse_a11y_settings;
GSettings *mouse_settings;
GSettings *gsd_mouse_settings;
- gboolean mousetweaks_daemon_running;
};
static void gsd_mouse_manager_class_init (GsdMouseManagerClass *klass);
@@ -72,87 +65,10 @@ gsd_mouse_manager_class_init (GsdMouseManagerClass *klass)
}
static void
-set_mousetweaks_daemon (GsdMouseManager *manager,
- gboolean dwell_click_enabled,
- gboolean secondary_click_enabled)
-{
- GError *error = NULL;
- gchar *comm;
- gboolean run_daemon = dwell_click_enabled || secondary_click_enabled;
-
- if (run_daemon || manager->mousetweaks_daemon_running)
- comm = g_strdup_printf ("mousetweaks %s",
- run_daemon ? "" : "-s");
- else
- return;
-
- if (run_daemon)
- manager->mousetweaks_daemon_running = TRUE;
-
- if (! g_spawn_command_line_async (comm, &error)) {
- if (error->code == G_SPAWN_ERROR_NOENT && run_daemon) {
- if (dwell_click_enabled) {
- g_settings_set_boolean (manager->mouse_a11y_settings,
- KEY_DWELL_CLICK_ENABLED, FALSE);
- } else if (secondary_click_enabled) {
- g_settings_set_boolean (manager->mouse_a11y_settings,
- KEY_SECONDARY_CLICK_ENABLED, FALSE);
- }
-
- g_warning ("Error enabling mouse accessibility features (mousetweaks is not installed)");
- }
- g_error_free (error);
- }
- g_free (comm);
-}
-
-static void
-mouse_callback (GSettings *settings,
- const gchar *key,
- GsdMouseManager *manager)
-{
- if (g_str_equal (key, KEY_DWELL_CLICK_ENABLED) ||
- g_str_equal (key, KEY_SECONDARY_CLICK_ENABLED)) {
- set_mousetweaks_daemon (manager,
- g_settings_get_boolean (settings, KEY_DWELL_CLICK_ENABLED),
- g_settings_get_boolean (settings, KEY_SECONDARY_CLICK_ENABLED));
- }
-}
-
-static void
gsd_mouse_manager_init (GsdMouseManager *manager)
{
}
-static gboolean
-gsd_mouse_manager_idle_cb (GsdMouseManager *manager)
-{
- gnome_settings_profile_start (NULL);
-
- manager->gsd_mouse_settings = g_settings_new (GSD_SETTINGS_MOUSE_SCHEMA);
- g_signal_connect (manager->gsd_mouse_settings, "changed",
- G_CALLBACK (mouse_callback), manager);
-
- manager->mouse_a11y_settings = g_settings_new ("org.gnome.desktop.a11y.mouse");
- g_signal_connect (manager->mouse_a11y_settings, "changed",
- G_CALLBACK (mouse_callback), manager);
-#if 0
- manager->mouse_settings = g_settings_new (GSETTINGS_MOUSE_SCHEMA);
- g_signal_connect (manager->mouse_settings, "changed",
- G_CALLBACK (mouse_callback), manager);
-#endif
-
- set_mousetweaks_daemon (manager,
- g_settings_get_boolean (manager->mouse_a11y_settings, KEY_DWELL_CLICK_ENABLED),
- g_settings_get_boolean (manager->mouse_a11y_settings, KEY_SECONDARY_CLICK_ENABLED));
-
- gnome_settings_profile_end (NULL);
-
- manager->start_idle_id = 0;
-
- return FALSE;
-}
-
gboolean
gsd_mouse_manager_start (GsdMouseManager *manager,
GError **error)
@@ -164,9 +80,6 @@ gsd_mouse_manager_start (GsdMouseManager *manager,
if (gnome_settings_is_wayland ())
return TRUE;
- manager->start_idle_id = g_idle_add ((GSourceFunc) gsd_mouse_manager_idle_cb, manager);
- g_source_set_name_by_id (manager->start_idle_id, "[gnome-settings-daemon] gsd_mouse_manager_idle_cb");
-
gnome_settings_profile_end (NULL);
return TRUE;
@@ -177,12 +90,6 @@ gsd_mouse_manager_stop (GsdMouseManager *manager)
{
g_debug ("Stopping mouse manager");
- if (manager->start_idle_id != 0) {
- g_source_remove (manager->start_idle_id);
- manager->start_idle_id = 0;
- }
-
- g_clear_object (&manager->mouse_a11y_settings);
g_clear_object (&manager->mouse_settings);
g_clear_object (&manager->touchpad_settings);
g_clear_object (&manager->gsd_mouse_settings);