[gnome-shell-extensions] apps-menu: Adapt to Clutter.Grab changes
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] apps-menu: Adapt to Clutter.Grab changes
- Date: Thu, 10 Feb 2022 16:18:54 +0000 (UTC)
commit 013b3fb73c22e107413d1c73ac57033931aad1b2
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Feb 10 00:26:36 2022 +0100
apps-menu: Adapt to Clutter.Grab changes
Device grabs are gone, switch to the new API.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/212>
extensions/apps-menu/extension.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 2cbb754..b9c3fca 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -180,11 +180,14 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
}
_onMotionEvent(actor, event) {
- let device = event.get_device();
- if (!device.get_grabbed_actor()) {
+ if (!this._grab) {
this._oldX = -1;
this._oldY = -1;
- device.grab(this);
+ const grab = global.stage.grab(this);
+ if (grab.get_seat_state() !== Clutter.GrabState.NONE)
+ this._grab = grab;
+ else
+ grab.dismiss();
}
this.hover = true;
@@ -194,7 +197,8 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem {
this._oldX = -1;
this._oldY = -1;
this.hover = false;
- device.ungrab();
+ this._grab?.dismiss();
+ delete this._grab;
let source = event.get_source();
if (source instanceof St.Widget)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]