From 40cf8de1a802aa6f4a659d3d93943638cf12fd37 Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Mon, 30 Jan 2023 14:46:56 +0100 Subject: [PATCH] Fix: Don't affect (or interact with) panel of unlock screen The panel gets set to the state it should have for the unlock screen before extension disable. Because of this the extension makes icons show, which shouldn't show. So fix that by not ordering the panel, if the current session mode isn't "user". Also generally don't interact with the panel, if the current session mode isn't "user". --- src/extension.js | 10 ++++++++++ src/extensionModules/BoxOrderManager.js | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/extension.js b/src/extension.js index e197917..73bfd24 100644 --- a/src/extension.js +++ b/src/extension.js @@ -94,6 +94,11 @@ class Extension { * @param {string} box - The box to order. */ #orderTopBarItems(box) { + // Only run, when in "user" session mode. + if(Main.sessionMode.currentMode !== "user") { + return; + } + // Get the valid box order. const validBoxOrder = this._boxOrderManager.createValidBoxOrder(box); @@ -147,6 +152,11 @@ class Extension { * orders the items of all top bar boxes. */ #handleNewItemsAndOrderTopBar() { + // Only run, when in "user" session mode. + if(Main.sessionMode.currentMode !== "user") { + return; + } + this._boxOrderManager.saveNewTopBarItems(); this.#orderTopBarItems("left"); this.#orderTopBarItems("center"); diff --git a/src/extensionModules/BoxOrderManager.js b/src/extensionModules/BoxOrderManager.js index 76ce2bb..9f04f33 100644 --- a/src/extensionModules/BoxOrderManager.js +++ b/src/extensionModules/BoxOrderManager.js @@ -184,6 +184,11 @@ var BoxOrderManager = GObject.registerClass({ * bar to the correct box orders. */ saveNewTopBarItems() { + // Only run, when in "user" session mode. + if(Main.sessionMode.currentMode !== "user") { + return; + } + // Load the configured box orders from settings. const boxOrders = { left: this.#settings.get_strv("left-box-order"),