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".
This commit is contained in:
Julian 2023-01-30 14:46:56 +01:00
parent 680c2a97af
commit 40cf8de1a8
Signed by: julian
GPG Key ID: 094C2AC34192FA11
2 changed files with 15 additions and 0 deletions

View File

@ -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");

View File

@ -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"),