[gnome-shell/wip/carlosg/clutter-seat: 5/9] padOsd: Use ClutterSeat to fetch devices



commit 2665c2e88fe95f4c5803d243002a74f9fd8576d3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Oct 5 12:36:52 2019 +0200

    padOsd: Use ClutterSeat to fetch devices
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/852

 js/ui/padOsd.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index a900a01162..be010b0f39 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -625,15 +625,15 @@ var PadOsd = class {
         this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
         this._padChooser = null;
 
-        let deviceManager = Clutter.DeviceManager.get_default();
-        this._deviceAddedId = deviceManager.connect('device-added', (manager, device) => {
+        let seat = Clutter.get_default_backend().get_default_seat();
+        this._deviceAddedId = seat.connect('device-added', (seat, device) => {
             if (device.get_device_type() == Clutter.InputDeviceType.PAD_DEVICE &&
                 this.padDevice.is_grouped(device)) {
                 this._groupPads.push(device);
                 this._updatePadChooser();
             }
         });
-        this._deviceRemovedId = deviceManager.connect('device-removed', (manager, device) => {
+        this._deviceRemovedId = seat.connect('device-removed', (seat, device) => {
             // If the device is being removed, destroy the padOsd.
             if (device == this.padDevice) {
                 this.destroy();
@@ -646,7 +646,7 @@ var PadOsd = class {
             }
         });
 
-        deviceManager.list_devices().forEach(device => {
+        seat.list_devices().forEach(device => {
             if (device != this.padDevice &&
                 device.get_device_type() == Clutter.InputDeviceType.PAD_DEVICE &&
                 this.padDevice.is_grouped(device))
@@ -926,13 +926,13 @@ var PadOsd = class {
         Main.popModal(this.actor);
         this._actionEditor.close();
 
-        let deviceManager = Clutter.DeviceManager.get_default();
+        let seat = Clutter.get_default_backend().get_default_seat();
         if (this._deviceRemovedId != 0) {
-            deviceManager.disconnect(this._deviceRemovedId);
+            seat.disconnect(this._deviceRemovedId);
             this._deviceRemovedId = 0;
         }
         if (this._deviceAddedId != 0) {
-            deviceManager.disconnect(this._deviceAddedId);
+            seat.disconnect(this._deviceAddedId);
             this._deviceAddedId = 0;
         }
 
@@ -958,8 +958,8 @@ var PadOsdService = class {
 
     ShowAsync(params, invocation) {
         let [deviceNode, editionMode] = params;
-        let deviceManager = Clutter.DeviceManager.get_default();
-        let devices = deviceManager.list_devices();
+        let seat = Clutter.get_default_backend().get_default_seat();
+        let devices = seat.list_devices();
         let padDevice = null;
 
         devices.forEach(device => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]