endSessionDialog: fix keyboard navigation
The addition of _backgroundStack to ModalDialog broke focus navigation, because it was interposed between the focus group root and all of the interesting content, but since it isn't an StWidget, st_widget_navigate_focus() was unable to navigate through it. Fix this by moving the focus root to this._dialogLayout (inside the _backgroundStack) instead. Additionally, in EndSessionDialog specifically, _initialKeyFocus wasn't being set until after opening the dialog, so it was ignored. Also change ModalDialog.close() to clear the _savedKeyFocus that popModal() set, so that dialogs that are repeatedly closed and reopened will have their focus revert back to _initialKeyFocus each time. https://bugzilla.gnome.org/show_bug.cgi?id=646740
This commit is contained in:
@ -408,10 +408,6 @@ EndSessionDialog.prototype = {
|
||||
},
|
||||
|
||||
_updateButtons: function() {
|
||||
if (this.state != ModalDialog.State.OPENING &&
|
||||
this.state != ModalDialog.State.OPENED)
|
||||
return;
|
||||
|
||||
let dialogContent = DialogContent[this._type];
|
||||
let buttons = [{ action: Lang.bind(this, this.cancel),
|
||||
label: _("Cancel"),
|
||||
@ -521,11 +517,12 @@ EndSessionDialog.prototype = {
|
||||
this._inhibitors.push(inhibitor);
|
||||
}
|
||||
|
||||
this._updateButtons();
|
||||
|
||||
if (!this.open(timestamp))
|
||||
throw new DBus.DBusError('org.gnome.Shell.ModalDialog.GrabError',
|
||||
"Cannot grab pointer and keyboard");
|
||||
|
||||
this._updateButtons();
|
||||
this._updateContent();
|
||||
|
||||
let signalId = this.connect('opened',
|
||||
|
Reference in New Issue
Block a user