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:
@ -37,6 +37,7 @@ const WindowManager = imports.ui.windowManager;
|
||||
const Magnifier = imports.ui.magnifier;
|
||||
const XdndHandler = imports.ui.xdndHandler;
|
||||
const KbdA11yDialog = imports.ui.kbdA11yDialog;
|
||||
const LocatePointer = imports.ui.locatePointer;
|
||||
|
||||
const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
|
||||
const STICKY_KEYS_ENABLE = 'stickykeys-enable';
|
||||
@ -74,6 +75,7 @@ var layoutManager = null;
|
||||
var kbdA11yDialog = null;
|
||||
var inputMethod = null;
|
||||
var introspectService = null;
|
||||
var locatePointer = null;
|
||||
let _startDate;
|
||||
let _defaultCssStylesheet = null;
|
||||
let _cssStylesheet = null;
|
||||
@ -92,6 +94,8 @@ function _sessionUpdated() {
|
||||
wm.allowKeybinding('overlay-key', Shell.ActionMode.NORMAL |
|
||||
Shell.ActionMode.OVERVIEW);
|
||||
|
||||
wm.allowKeybinding('locate-pointer-key', Shell.ActionMode.ALL);
|
||||
|
||||
wm.setCustomKeybindingHandler('panel-run-dialog',
|
||||
Shell.ActionMode.NORMAL |
|
||||
Shell.ActionMode.OVERVIEW,
|
||||
@ -165,6 +169,8 @@ function _initializeUI() {
|
||||
kbdA11yDialog = new KbdA11yDialog.KbdA11yDialog();
|
||||
wm = new WindowManager.WindowManager();
|
||||
magnifier = new Magnifier.Magnifier();
|
||||
locatePointer = new LocatePointer.locatePointer();
|
||||
|
||||
if (LoginManager.canLock())
|
||||
screenShield = new ScreenShield.ScreenShield();
|
||||
|
||||
@ -190,6 +196,10 @@ function _initializeUI() {
|
||||
overview.toggle();
|
||||
});
|
||||
|
||||
global.connect('locate-pointer', () => {
|
||||
locatePointer.show();
|
||||
});
|
||||
|
||||
global.display.connect('show-restart-message', (display, message) => {
|
||||
showRestartMessage(message);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user