From f811dfdb331f1d14780b597d01d9db2eb5b1c0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Mon, 5 Feb 2018 23:08:58 +0100 Subject: [PATCH] More robust init guard `initCount` would be reset when reloading `extension.js`, this change should handle those cases. --- extension.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extension.js b/extension.js index b5c6fd0..3f5036f 100644 --- a/extension.js +++ b/extension.js @@ -17,7 +17,7 @@ const Lang = imports.lang; let SESSIONID = ""+(new Date().getTime()); // The extension sometimes go through multiple init -> enable -> disable cycles.. // Keep track of the count here. -let initCount = 0; +let initRun; let enabled = false; let isDuringGnomeShellStartup = false; @@ -32,12 +32,12 @@ function init() { SESSIONID += "#" debug('init', SESSIONID); - if(initCount > 0) { + if(initRun) { debug("#startup", "Reinitialized against our will! Skip adding bindings again to not cause trouble. ('disable()' isn't fully implemented yet)") return; } - initCount++; + initRun = true; wmSettings = new Gio.Settings({ schema_id: "org.gnome.desktop.wm.keybindings"});