panel: Use MetaWindow API to begin grab operation on window

Move away from MetaDisplay API.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2526>
This commit is contained in:
Carlos Garnacho 2022-09-29 18:53:45 +02:00 committed by Marge Bot
parent 238a17c6b5
commit 64d07ff7cd

View File

@ -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) {