[gnome-shell/wip/carlosg/dnd-key-events: 2/2] dnd: Drop captured event handler




commit 5c5e915e5a767a1eba9203c4f90d2b465e743d1b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 2 17:07:42 2022 +0100

    dnd: Drop captured event handler
    
    This was here exclusively to silence out events from other pointing
    devices in the stage. Since ClutterGrab being used now is global to
    all devices and events are coerced to an invisible actor, there is
    no need to explicitly do this.
    
    Also, this event handler was set on the stage, while the grab happened
    on a child, so it was fairly uneffective already.

 js/ui/dnd.js | 13 -------------
 1 file changed, 13 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 9fbdf28738..ebe1178627 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -167,22 +167,9 @@ var _Draggable = class _Draggable {
         this._grab = global.stage.grab(actor);
         this._grabbedDevice = pointer;
         this._touchSequence = touchSequence;
-
-        this._capturedEventId = global.stage.connect('captured-event', (o, event) => {
-            let device = event.get_device();
-            if (device != this._grabbedDevice &&
-                device.get_device_type() != Clutter.InputDeviceType.KEYBOARD_DEVICE)
-                return Clutter.EVENT_STOP;
-            return Clutter.EVENT_PROPAGATE;
-        });
     }
 
     _ungrabDevice() {
-        if (this._capturedEventId != 0) {
-            global.stage.disconnect(this._capturedEventId);
-            this._capturedEventId = 0;
-        }
-
         if (this._grab) {
             this._grab.dismiss();
             this._grab = null;


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