screenshot: Port to Clutter.Grab

Stop using device/sequence grabs for corner handles. Also
make the toplevel actor reactive, so it can handle the key events
it means to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
This commit is contained in:
Carlos Garnacho 2022-01-28 12:13:45 +01:00
parent 21913b45af
commit 21cc534add

View File

@ -375,10 +375,10 @@ var UIAreaSelector = GObject.registerClass({
if (!this._dragButton) if (!this._dragButton)
return; return;
if (this._dragSequence) if (this._dragGrab) {
this._dragDevice.sequence_ungrab(this._dragSequence); this._dragGrab.dismiss();
else this._dragGrab = null;
this._dragDevice.ungrab(); }
this._dragButton = 0; this._dragButton = 0;
this._dragDevice = null; this._dragDevice = null;
@ -495,11 +495,8 @@ var UIAreaSelector = GObject.registerClass({
if (this._dragButton) { if (this._dragButton) {
const device = event.device; const device = event.device;
if (sequence)
device.sequence_grab(sequence, this);
else
device.grab(this);
this._dragGrab = global.stage.grab(this);
this._dragDevice = device; this._dragDevice = device;
this._dragSequence = sequence; this._dragSequence = sequence;
@ -1010,6 +1007,7 @@ class ScreenshotUI extends St.Widget {
layout_manager: new Clutter.BinLayout(), layout_manager: new Clutter.BinLayout(),
opacity: 0, opacity: 0,
visible: false, visible: false,
reactive: true,
}); });
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });