[gnome-shell] polkitAgent: Ensure cleanup if dialog wasn't shown



commit 21faae480ed3a3794192864dab8ea006b1592c39
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 10 00:10:03 2021 +0100

    polkitAgent: Ensure cleanup if dialog wasn't shown
    
    It is possible for an initiated session to complete without
    a request if polkit can authenticate the action without user
    input. We fail to clean up after ourselves in that case, as
    the cleanup is done after the dialog is closed.
    
    The dialog can still be shown when the code that hides existing
    dialogs while the screen is locked shows it on unlock. But as
    the session was closed, the dialog is now defunct and cannot
    be dismissed by the user.
    
    Fix this by running the cleanup on close() when the dialog
    wasn't shown.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3701
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1662>

 js/ui/components/polkitAgent.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index e8f3b30f43..5127ab924d 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -380,6 +380,13 @@ var AuthenticationDialog = GObject.registerClass({
         }
     }
 
+    close(timestamp) {
+        // Ensure cleanup if the dialog was never shown
+        if (this.state === ModalDialog.State.CLOSED)
+            this._onDialogClosed();
+        super.close(timestamp);
+    }
+
     cancel() {
         this.close(global.get_current_time());
         this._emitDone(true);


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