locatePointer: Add implementation in gnome-shell
The "locate pointer" functionality was implemented in gnome settings daemon using X11 protocols and would fail when run under Wayland. With Wayland, there is no global coordinate space exposed to the clients so this functionality cannot be implemented as a separate program. Instead, add the "locate pointer" functionality in gnome-shell so that it works in both X11 and Wayland. https://gitlab.gnome.org/GNOME/gnome-shell/issues/981 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/413 https://gitlab.gnome.org/GNOME/mutter/merge_requests/453 https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/merge_requests/19 https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/86
This commit is contained in:
@ -346,6 +346,13 @@ gnome_shell_plugin_create_inhibit_shortcuts_dialog (MetaPlugin *plugin,
|
||||
return _shell_wm_create_inhibit_shortcuts_dialog (get_shell_wm (), window);
|
||||
}
|
||||
|
||||
static void
|
||||
gnome_shell_plugin_locate_pointer (MetaPlugin *plugin)
|
||||
{
|
||||
GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin);
|
||||
_shell_global_locate_pointer (shell_plugin->global);
|
||||
}
|
||||
|
||||
static void
|
||||
gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
|
||||
{
|
||||
@ -378,6 +385,8 @@ gnome_shell_plugin_class_init (GnomeShellPluginClass *klass)
|
||||
|
||||
plugin_class->create_close_dialog = gnome_shell_plugin_create_close_dialog;
|
||||
plugin_class->create_inhibit_shortcuts_dialog = gnome_shell_plugin_create_inhibit_shortcuts_dialog;
|
||||
|
||||
plugin_class->locate_pointer = gnome_shell_plugin_locate_pointer;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -18,4 +18,6 @@ GjsContext *_shell_global_get_gjs_context (ShellGlobal *global);
|
||||
gboolean _shell_global_check_xdnd_event (ShellGlobal *global,
|
||||
XEvent *xev);
|
||||
|
||||
void _shell_global_locate_pointer (ShellGlobal *global);
|
||||
|
||||
#endif /* __SHELL_GLOBAL_PRIVATE_H__ */
|
||||
|
@ -115,6 +115,7 @@ enum {
|
||||
enum
|
||||
{
|
||||
NOTIFY_ERROR,
|
||||
LOCATE_POINTER,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@ -357,6 +358,13 @@ shell_global_class_init (ShellGlobalClass *klass)
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
shell_global_signals[LOCATE_POINTER] =
|
||||
g_signal_new ("locate-pointer",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_SESSION_MODE,
|
||||
@ -1732,3 +1740,9 @@ shell_global_get_persistent_state (ShellGlobal *global,
|
||||
{
|
||||
return load_variant (global->userdatadir_path, property_type, property_name);
|
||||
}
|
||||
|
||||
void
|
||||
_shell_global_locate_pointer (ShellGlobal *global)
|
||||
{
|
||||
g_signal_emit (global, shell_global_signals[LOCATE_POINTER], 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user