From bfa34914db7867fbdb8f85c7136c7e7e8dff5ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 17 Apr 2020 17:51:27 +0200 Subject: [PATCH] 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 4bfbde1bb..d77f797c0 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) {