From ca291402bc4be0ef3bc41f5ced7d65fe04249f20 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Mon, 29 Jul 2019 14:33:50 +0200 Subject: [PATCH] universal-access: Add "Locate Pointer" option Since [0] and [1], "locate pointer" is now in Mutter and works well under Wayland and X11. Once activated, the mouse pointer can be located on the screen by pressing the Ctrl key. Pressing Ctrl will cause an animation to appear briefly at the location of your pointer. [0] https://gitlab.gnome.org/GNOME/mutter/merge_requests/453 [1] https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/413 Fixes #586 --- panels/universal-access/cc-ua-panel.c | 7 ++++++ panels/universal-access/cc-ua-panel.ui | 32 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c index aebdd572b..54c1570d7 100644 --- a/panels/universal-access/cc-ua-panel.c +++ b/panels/universal-access/cc-ua-panel.c @@ -49,6 +49,7 @@ #define KEY_CURSOR_BLINKING "cursor-blink" #define KEY_CURSOR_BLINKING_TIME "cursor-blink-time" #define KEY_MOUSE_CURSOR_SIZE "cursor-size" +#define KEY_LOCATE_POINTER "locate-pointer" /* application settings */ #define APPLICATION_SETTINGS "org.gnome.desktop.a11y.applications" @@ -111,6 +112,7 @@ struct _CcUaPanel GtkWidget *list_seeing; GtkWidget *list_typing; GtkWidget *mouse_keys_switch; + GtkWidget *locate_pointer_switch; GtkWidget *pointing_dialog; GtkWidget *pointing_dwell_delay_box; GtkWidget *pointing_dwell_delay_scale; @@ -251,6 +253,7 @@ cc_ua_panel_class_init (CcUaPanelClass *klass) gtk_widget_class_bind_template_child (widget_class, CcUaPanel, list_seeing); gtk_widget_class_bind_template_child (widget_class, CcUaPanel, list_typing); gtk_widget_class_bind_template_child (widget_class, CcUaPanel, mouse_keys_switch); + gtk_widget_class_bind_template_child (widget_class, CcUaPanel, locate_pointer_switch); gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dialog); gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_box); gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_scale); @@ -1050,6 +1053,10 @@ cc_ua_panel_init_mouse (CcUaPanel *self) self->mouse_keys_switch, "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (self->interface_settings, KEY_LOCATE_POINTER, + self->locate_pointer_switch, "active", + G_SETTINGS_BIND_DEFAULT); + g_signal_connect (self->mouse_settings, "changed", G_CALLBACK (update_click_assist_label), self); update_click_assist_label (self->mouse_settings, NULL, self); diff --git a/panels/universal-access/cc-ua-panel.ui b/panels/universal-access/cc-ua-panel.ui index 4e9e2489c..ba77b79ad 100644 --- a/panels/universal-access/cc-ua-panel.ui +++ b/panels/universal-access/cc-ua-panel.ui @@ -881,6 +881,38 @@ + + + True + True + False + False + + + True + + + True + True + False + 12 + 0 + _Locate Pointer + True + locate_pointer_switch + + + + + True + True + 12 + + + + + + True