Pass events to the OSK in dialogs which grab events

With commit c29e0cf6e6 the grabHelper
already started using a similar mechanism to funnel events to the osk
while a ClutterGrab is in effect. ModalDialog, the unlockDialog and
lookingGlass don't make use of the grabHelper though, they use
Main.pushModal() themselves, so those need to funnel the events to the
OSK themselves.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2263>
This commit is contained in:
Jonas Dreßler 2022-04-06 12:51:45 +02:00 committed by Marge Bot
parent 61713c7366
commit 66331e1244
3 changed files with 21 additions and 0 deletions

View File

@ -1421,6 +1421,13 @@ class LookingGlass extends St.BoxLayout {
this._resize();
}
vfunc_captured_event(event) {
if (Main.keyboard.maybeHandleEvent(event))
return Clutter.EVENT_STOP;
return Clutter.EVENT_PROPAGATE;
}
_updateFont() {
let fontName = this._interfaceSettings.get_string('monospace-font-name');
let fontDesc = Pango.FontDescription.from_string(fontName);

View File

@ -114,6 +114,13 @@ var ModalDialog = GObject.registerClass({
return Clutter.EVENT_PROPAGATE;
}
vfunc_captured_event(event) {
if (Main.keyboard.maybeHandleEvent(event))
return Clutter.EVENT_STOP;
return Clutter.EVENT_PROPAGATE;
}
clearButtons() {
this.dialogLayout.clearButtons();
}

View File

@ -625,6 +625,13 @@ var UnlockDialog = GObject.registerClass({
return Clutter.EVENT_PROPAGATE;
}
vfunc_captured_event(event) {
if (Main.keyboard.maybeHandleEvent(event))
return Clutter.EVENT_STOP;
return Clutter.EVENT_PROPAGATE;
}
_createBackground(monitorIndex) {
let monitor = Main.layoutManager.monitors[monitorIndex];
let widget = new St.Widget({