mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
modal-dialog: Don't let buttons steal manually-set focus
ModalDialog provides a method to set the initial focus. However, when adding buttons, the initial focus is always set to the last button, thus overwriting a previously set manual focus. Instead, only set the initial key focus if setInitialKeyFocus() has not been called manually before. https://bugzilla.gnome.org/show_bug.cgi?id=659133
This commit is contained in:
parent
2140a498a2
commit
6d92af17fd
1 changed files with 3 additions and 1 deletions
|
|
@ -131,7 +131,9 @@ ModalDialog.prototype = {
|
|||
else
|
||||
x_alignment = St.Align.MIDDLE;
|
||||
|
||||
this._initialKeyFocus = buttonInfo.button;
|
||||
if (this._initialKeyFocus == this._dialogLayout ||
|
||||
this._buttonLayout.contains(this._initialKeyFocus))
|
||||
this._initialKeyFocus = buttonInfo.button;
|
||||
this._buttonLayout.add(buttonInfo.button,
|
||||
{ expand: true,
|
||||
x_fill: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue