[gnome-shell/wip/carlosg/grabs-pt2: 36/51] lookingGlass: Use Clutter.grab() for actor picking
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/grabs-pt2: 36/51] lookingGlass: Use Clutter.grab() for actor picking
- Date: Fri, 28 Jan 2022 11:42:30 +0000 (UTC)
commit 7aab51129944c7df26c7f3c0abdda1fa57e246fe
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Nov 18 00:13:45 2021 +0100
lookingGlass: Use Clutter.grab() for actor picking
js/ui/lookingGlass.js | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 433102cfb6..b3e7f21178 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -558,12 +558,7 @@ var Inspector = GObject.registerClass({
eventHandler.connect('scroll-event', this._onScrollEvent.bind(this));
eventHandler.connect('motion-event', this._onMotionEvent.bind(this));
- let seat = Clutter.get_default_backend().get_default_seat();
- this._pointerDevice = seat.get_pointer();
- this._keyboardDevice = seat.get_keyboard();
-
- this._pointerDevice.grab(eventHandler);
- this._keyboardDevice.grab(eventHandler);
+ this._grab = global.stage.grab(eventHandler);
// this._target is the actor currently shown by the inspector.
// this._pointerTarget is the actor directly under the pointer.
@@ -596,8 +591,10 @@ var Inspector = GObject.registerClass({
}
_close() {
- this._pointerDevice.ungrab();
- this._keyboardDevice.ungrab();
+ if (this._grab) {
+ this._grab.dismiss();
+ this._grab = null;
+ }
this._eventHandler.destroy();
this._eventHandler = null;
this.emit('closed');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]