[gnome-shell] polkitAgent: Only reset UI on session resets while opened



commit 3a7228cf2fbf1e92e85d366683e94a57c396f312
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Nov 14 18:51:01 2019 +0100

    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

 js/ui/components/polkitAgent.js | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index 9fa3dff5d4..1817aac05f 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]