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
This commit is contained in:
Felipe Borges 2019-07-29 14:33:50 +02:00 committed by Georges Basile Stavracas Neto
parent 0d096f4c52
commit ca291402bc
2 changed files with 39 additions and 0 deletions

View file

@ -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);

View file

@ -881,6 +881,38 @@
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selectable">False</property>
<property name="activatable">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="expand">True</property>
<property name="can_focus">False</property>
<property name="margin">12</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Locate Pointer</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">locate_pointer_switch</property>
</object>
</child>
<child>
<object class="GtkSwitch" id="locate_pointer_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin">12</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow" id="row_click_assist">
<property name="visible">True</property>