[gnome-shell/wip/carlosg/clutter-seat: 4/9] ui: Use ClutterSeat for keyboard/pointer a11y
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/clutter-seat: 4/9] ui: Use ClutterSeat for keyboard/pointer a11y
- Date: Mon, 14 Oct 2019 08:13:25 +0000 (UTC)
commit 9f6da1be91ef18de8aecb53c41c971485ad515c3
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Oct 5 12:35:21 2019 +0200
ui: Use ClutterSeat for keyboard/pointer a11y
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/760
js/ui/kbdA11yDialog.js | 8 ++++----
js/ui/keyboard.js | 4 ++--
js/ui/pointerA11yTimeout.js | 6 +++---
js/ui/status/dwellClick.js | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/kbdA11yDialog.js b/js/ui/kbdA11yDialog.js
index f5ffccce7c..b7689e191a 100644
--- a/js/ui/kbdA11yDialog.js
+++ b/js/ui/kbdA11yDialog.js
@@ -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',
- this._showKbdA11yDialog.bind(this));
+ 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, body;
let key, enabled;
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index c52bc1a6c9..dc5d5bf69a 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1717,8 +1717,8 @@ var Keyboard = class Keyboard {
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',
diff --git a/js/ui/pointerA11yTimeout.js b/js/ui/pointerA11yTimeout.js
index 516dcf039c..1ee32ec100 100644
--- a/js/ui/pointerA11yTimeout.js
+++ b/js/ui/pointerA11yTimeout.js
@@ -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', (manager, device, type, timeout) => {
+ seat.connect('ptr-a11y-timeout-started', (seat, 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', (manager, device, type, clicked) => {
+ seat.connect('ptr-a11y-timeout-stopped', (seat, device, type, clicked) => {
if (!clicked)
this._pieTimer.destroy();
diff --git a/js/ui/status/dwellClick.js b/js/ui/status/dwellClick.js
index 4ce8e7544b..edd6813964 100644
--- a/js/ui/status/dwellClick.js
+++ b/js/ui/status/dwellClick.js
@@ -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;
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]