ui: Use ClutterSeat for keyboard/pointer a11y
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/760
This commit is contained in:
parent
8d88a9b9c4
commit
84d92bf65e
@ -15,12 +15,12 @@ class KbdA11yDialog extends GObject.Object {
|
||||
|
||||
this._a11ySettings = new Gio.Settings({ schema_id: KEYBOARD_A11Y_SCHEMA });
|
||||
|
||||
let deviceManager = Clutter.DeviceManager.get_default();
|
||||
deviceManager.connect('kbd-a11y-flags-changed',
|
||||
let seat = Clutter.get_default_backend().get_default_seat();
|
||||
seat.connect('kbd-a11y-flags-changed',
|
||||
this._showKbdA11yDialog.bind(this));
|
||||
}
|
||||
|
||||
_showKbdA11yDialog(deviceManager, newFlags, whatChanged) {
|
||||
_showKbdA11yDialog(seat, newFlags, whatChanged) {
|
||||
let dialog = new ModalDialog.ModalDialog();
|
||||
let title, description;
|
||||
let key, enabled;
|
||||
|
@ -1829,8 +1829,8 @@ class Keyboard extends St.BoxLayout {
|
||||
|
||||
var KeyboardController = class {
|
||||
constructor() {
|
||||
let deviceManager = Clutter.DeviceManager.get_default();
|
||||
this._virtualDevice = deviceManager.create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
||||
let seat = Clutter.get_default_backend().get_default_seat();
|
||||
this._virtualDevice = seat.create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
|
||||
|
||||
this._inputSourceManager = InputSourceManager.getInputSourceManager();
|
||||
this._sourceChangedId = this._inputSourceManager.connect('current-source-changed',
|
||||
|
@ -108,9 +108,9 @@ var PieTimer = GObject.registerClass({
|
||||
|
||||
var PointerA11yTimeout = class PointerA11yTimeout {
|
||||
constructor() {
|
||||
let manager = Clutter.DeviceManager.get_default();
|
||||
let seat = Clutter.get_default_backend().get_default_seat();
|
||||
|
||||
manager.connect('ptr-a11y-timeout-started', (o, device, type, timeout) => {
|
||||
seat.connect('ptr-a11y-timeout-started', (o, device, type, timeout) => {
|
||||
let [x, y] = global.get_pointer();
|
||||
|
||||
this._pieTimer = new PieTimer();
|
||||
@ -123,7 +123,7 @@ var PointerA11yTimeout = class PointerA11yTimeout {
|
||||
global.display.set_cursor(Meta.Cursor.CROSSHAIR);
|
||||
});
|
||||
|
||||
manager.connect('ptr-a11y-timeout-stopped', (o, device, type, clicked) => {
|
||||
seat.connect('ptr-a11y-timeout-stopped', (o, device, type, clicked) => {
|
||||
if (!clicked)
|
||||
this._pieTimer.destroy();
|
||||
|
||||
|
@ -48,8 +48,8 @@ class DwellClickIndicator extends PanelMenu.Button {
|
||||
this._a11ySettings.connect(`changed::${KEY_DWELL_CLICK_ENABLED}`, this._syncMenuVisibility.bind(this));
|
||||
this._a11ySettings.connect(`changed::${KEY_DWELL_MODE}`, this._syncMenuVisibility.bind(this));
|
||||
|
||||
this._deviceManager = Clutter.DeviceManager.get_default();
|
||||
this._deviceManager.connect('ptr-a11y-dwell-click-type-changed', this._updateClickType.bind(this));
|
||||
this._seat = Clutter.get_default_backend().get_default_seat();
|
||||
this._seat.connect('ptr-a11y-dwell-click-type-changed', this._updateClickType.bind(this));
|
||||
|
||||
this._addDwellAction(DWELL_CLICK_MODES.primary);
|
||||
this._addDwellAction(DWELL_CLICK_MODES.double);
|
||||
@ -80,7 +80,7 @@ class DwellClickIndicator extends PanelMenu.Button {
|
||||
}
|
||||
|
||||
_setClickType(mode) {
|
||||
this._deviceManager.set_pointer_a11y_dwell_click_type(mode.type);
|
||||
this._seat.set_pointer_a11y_dwell_click_type(mode.type);
|
||||
this._icon.icon_name = mode.icon;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user