From 64d07ff7cdb6e79761363038666e206d4a1c8880 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 29 Sep 2022 18:53:45 +0200 Subject: [PATCH] panel: Use MetaWindow API to begin grab operation on window Move away from MetaDisplay API. Part-of: --- js/ui/panel.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/js/ui/panel.js b/js/ui/panel.js index 94dffda73..cac922ac8 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -540,24 +540,16 @@ class Panel extends St.Widget { if (targetActor !== this) return Clutter.EVENT_PROPAGATE; - const [x, y] = event.get_coords(); + const [x, y_] = event.get_coords(); let dragWindow = this._getDraggableWindowForPosition(x); if (!dragWindow) return Clutter.EVENT_PROPAGATE; - const button = event.type() === Clutter.EventType.BUTTON_PRESS - ? event.get_button() : -1; - - return global.display.begin_grab_op( - dragWindow, + return dragWindow.begin_grab_op( Meta.GrabOp.MOVING, - false, /* pointer grab */ true, /* frame action */ - button, - event.get_state(), - event.get_time(), - x, y) ? Clutter.EVENT_STOP : Clutter.EVENT_PROPAGATE; + event.get_time()) ? Clutter.EVENT_STOP : Clutter.EVENT_PROPAGATE; } _onButtonPress(actor, event) {