From 9c379123e7b9a54242cfc6ee4ec24eb0630a235b Mon Sep 17 00:00:00 2001 From: xSmurf Date: Sun, 7 Jan 2018 20:26:12 +0000 Subject: [PATCH] Push_modal failure tentative five... --- gnome-shell/firewall@subgraph.com/extension.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gnome-shell/firewall@subgraph.com/extension.js b/gnome-shell/firewall@subgraph.com/extension.js index d8d8639..c6b09a5 100644 --- a/gnome-shell/firewall@subgraph.com/extension.js +++ b/gnome-shell/firewall@subgraph.com/extension.js @@ -91,6 +91,7 @@ const FirewallPromptHandler = new Lang.Class({ Gio.bus_own_name_on_connection(Gio.DBus.system, 'com.subgraph.FirewallPrompt', Gio.BusNameOwnerFlags.REPLACE, null, null); this._dialogs = new Array(); this._dialog = null; + this._promptTimeout = null; this._initKeybindings(); }, @@ -99,6 +100,9 @@ const FirewallPromptHandler = new Lang.Class({ this._closeDialogs(); this._dbusImpl.unexport(); this._destroyKeybindings(); + if (this._promptTimeout !== null) { + GLib.source_remove(this._promptTimeout); + } }, _initKeybindings: function() { @@ -181,11 +185,17 @@ const FirewallPromptHandler = new Lang.Class({ this._dialog = new Dialog.PromptDialog(invocation, (pid >= 0), (sandbox != ""), tlsguard); this._dialog.update(app, icon, path, address, port, ip, origin, uid, gid, user, group, pid, proto, tlsguard, optstring, sandbox, expanded, expert, action); this._dialog.connect("closed", Lang.bind(this, this.onCloseDialog)); - let dio = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, Lang.bind(this, function() { + let fcount = 0; + this._promptTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 10, Lang.bind(this, function() { if (this._dialog.open()) { - GLib.source_remove(dio); - dio = null; + return false; + } + if (fcount++ > 100) { + this._dialog.destroy(); + log("SGFW: Failed creating dialog, repeated pushModal failures!"); + return false; } + return true; })); } catch (err) { log("SGFW: Error while creating prompt: " + err);