[gnome-shell] polkitAgent: Return GLib.SOURCE_REMOVE on timeout callback



commit bfa34914db7867fbdb8f85c7136c7e7e8dff5ce9
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Apr 17 17:51:27 2020 +0200

    polkitAgent: Return GLib.SOURCE_REMOVE on timeout callback
    
    resetDialog is used (also) as GLib timeout function, so while just returning
    an undefined value will stop the timeout anyways, it's just cleaner to
    use the GSource expected return values
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1203

 js/ui/components/polkitAgent.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index 4bfbde1bb0..d77f797c0c 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -328,11 +328,13 @@ var AuthenticationDialog = GObject.registerClass({
 
         let resetDialog = () => {
             if (this.state != ModalDialog.State.OPENED)
-                return;
+                return GLib.SOURCE_REMOVE;
 
             this._passwordEntry.hide();
             this._cancelButton.grab_key_focus();
             this._okButton.reactive = false;
+
+            return GLib.SOURCE_REMOVE;
         };
 
         if (delay) {


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