e357559582
eslint cannot figure out that those symbols are used from other modules via imports, so they trigger unused-variable errors. To fix, explicitly mark those symbols as exported. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
26 lines
746 B
JavaScript
26 lines
746 B
JavaScript
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
|
/* exported LocatePointer */
|
|
|
|
const { Gio } = imports.gi;
|
|
const Ripples = imports.ui.ripples;
|
|
const Main = imports.ui.main;
|
|
|
|
const LOCATE_POINTER_KEY = "locate-pointer";
|
|
const LOCATE_POINTER_SCHEMA = "org.gnome.desktop.interface";
|
|
|
|
var LocatePointer = class {
|
|
constructor() {
|
|
this._settings = new Gio.Settings({ schema_id: LOCATE_POINTER_SCHEMA });
|
|
this._ripples = new Ripples.Ripples(0.5, 0.5, 'ripple-pointer-location');
|
|
this._ripples.addTo(Main.uiGroup);
|
|
}
|
|
|
|
show() {
|
|
if (!this._settings.get_boolean(LOCATE_POINTER_KEY))
|
|
return;
|
|
|
|
let [x, y] = global.get_pointer();
|
|
this._ripples.playAnimation(x, y);
|
|
}
|
|
};
|