From cff09617f3bd209cd9e7b5b92b979d051e1f9a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Feb 2022 18:10:46 +0100 Subject: [PATCH] lookingGlass: Take separate grab for object inspector The object inspector is not a child of the main looking glass dialog, so it no longer receives pointer/touch events with the new grab API. Fix this by pushing/popping a separate grab. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5150 Part-of: --- js/ui/lookingGlass.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 96f4d9cd7..30d668f3c 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -451,6 +451,14 @@ class ObjInspector extends St.ScrollView { open(sourceActor) { if (this._open) return; + + const grab = Main.pushModal(this, { actionMode: Shell.ActionMode.LOOKING_GLASS }); + if (grab.get_seat_state() === Clutter.GrabState.NONE) { + Main.popModal(grab); + return; + } + + this._grab = grab; this._previousObj = null; this._open = true; this.show(); @@ -470,6 +478,8 @@ class ObjInspector extends St.ScrollView { close() { if (!this._open) return; + Main.popModal(this._grab); + this._grab = null; this._open = false; this.hide(); this._previousObj = null;