padOsd: Capture events on itself
This actor is setting itself modal, should also stop listening to events from above it, since none will be gotten. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2045>
This commit is contained in:
parent
5305bee94c
commit
f2cca5cccb
@ -638,7 +638,6 @@ var PadOsd = GObject.registerClass({
|
|||||||
this._settings = settings;
|
this._settings = settings;
|
||||||
this._imagePath = imagePath;
|
this._imagePath = imagePath;
|
||||||
this._editionMode = editionMode;
|
this._editionMode = editionMode;
|
||||||
this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
|
|
||||||
this._padChooser = null;
|
this._padChooser = null;
|
||||||
|
|
||||||
let seat = Clutter.get_default_backend().get_default_seat();
|
let seat = Clutter.get_default_backend().get_default_seat();
|
||||||
@ -762,7 +761,7 @@ var PadOsd = GObject.registerClass({
|
|||||||
this._padDiagram.updateLabels(this._getActionText.bind(this));
|
this._padDiagram.updateLabels(this._getActionText.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_onCapturedEvent(actor, event) {
|
vfunc_captured_event(event) {
|
||||||
let isModeSwitch =
|
let isModeSwitch =
|
||||||
(event.type() == Clutter.EventType.PAD_BUTTON_PRESS ||
|
(event.type() == Clutter.EventType.PAD_BUTTON_PRESS ||
|
||||||
event.type() == Clutter.EventType.PAD_BUTTON_RELEASE) &&
|
event.type() == Clutter.EventType.PAD_BUTTON_RELEASE) &&
|
||||||
@ -933,11 +932,6 @@ var PadOsd = GObject.registerClass({
|
|||||||
this._deviceAddedId = 0;
|
this._deviceAddedId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._capturedEventId != 0) {
|
|
||||||
global.stage.disconnect(this._capturedEventId);
|
|
||||||
this._capturedEventId = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.emit('closed');
|
this.emit('closed');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user