polkitAgent: Only reset UI on session resets while opened

Since `_destroySession()` is not only called before we try to initiate a
new authentication session with Polkit, but also when the dialog is
closed, it's currently possible that key focus is grabbed by the close
button after the dialog was dismissed and hidden. This is causing a bug
where after dismissing one of multiple queued dialogs, key focus goes
away and keyboard navigation with the new dialog is impossible.

Fix this by only resetting the UI of the dialog if the dialog is still
opened/visible at that point.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/828
This commit is contained in:
Jonas Dreßler 2019-11-14 18:51:01 +01:00 committed by Florian Müllner
parent c1ae634174
commit 3a7228cf2f

View File

@ -319,6 +319,9 @@ var AuthenticationDialog = GObject.registerClass({
}
let resetDialog = () => {
if (this.state != ModalDialog.State.OPENED)
return;
this._passwordBox.hide();
this._cancelButton.grab_key_focus();
this._okButton.reactive = false;