mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
closeDialog: Actually set key focus to button when grabbing key focus
When setting the key focus to `this._dialog`, the default button is not
automatically focused and no button has key focus.
Use the `initialKeyFocus` property of the dialog instead, and set focus
to the default button if the dialog is not already focused.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/786>
(cherry picked from commit de834fe307)
This commit is contained in:
parent
e87681dbd9
commit
5ab26d669d
1 changed files with 6 additions and 2 deletions
|
|
@ -208,7 +208,11 @@ export const CloseDialog = GObject.registerClass({
|
|||
}
|
||||
|
||||
vfunc_focus() {
|
||||
if (this._dialog)
|
||||
this._dialog.grab_key_focus();
|
||||
if (!this._dialog)
|
||||
return;
|
||||
|
||||
const keyFocus = global.stage.key_focus;
|
||||
if (!keyFocus || !this._dialog.contains(keyFocus))
|
||||
this._dialog.initialKeyFocus.grab_key_focus();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue