From 6147689e2182b22ffa2919361361c6566295e11f Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Sun, 12 May 2024 20:53:17 +0200 Subject: [PATCH 1/3] Fix communication with DING The extension state naming has changed from gnome shell 45 to gnome shell 46, so the code to notify margins to DING wasn't being able to detect when an extension was active, and so it didn't prevent to put icons below the dock. This patch fixes it. --- desktopIconsIntegration.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktopIconsIntegration.js b/desktopIconsIntegration.js index e63750136..6412a87b7 100644 --- a/desktopIconsIntegration.js +++ b/desktopIconsIntegration.js @@ -153,7 +153,8 @@ export class DesktopIconsUsableAreaClass { _sendMarginsToExtension(extension) { // check that the extension is an extension that has the logic to accept // working margins - if (extension?.state !== ExtensionUtils.ExtensionState.ENABLED) + if ((extension?.state !== ExtensionUtils.ExtensionState.ENABLED) && + (extension?.state !== ExtensionUtils.ExtensionState.ACTIVE)) return; const usableArea = extension?.stateObj?.DesktopIconsUsableArea; From 8c31faf191848c91d5bfdd7df53573372fb9938f Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Thu, 16 May 2024 15:30:00 +0200 Subject: [PATCH 2/3] Apply changes in all cases --- desktopIconsIntegration.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktopIconsIntegration.js b/desktopIconsIntegration.js index 6412a87b7..c1d46773a 100644 --- a/desktopIconsIntegration.js +++ b/desktopIconsIntegration.js @@ -63,6 +63,10 @@ import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; const IDENTIFIER_UUID = '130cbc66-235c-4bd6-8571-98d2d8bba5e2'; export class DesktopIconsUsableAreaClass { + _checkIfExtensionIsEnabled(extension) { + return ((extension?.state === ExtensionUtils.ExtensionState.ENABLED) || (extension?.state === ExtensionUtils.ExtensionState.ACTIVE)); + } + constructor() { const Me = Extension.lookupByURL(import.meta.url); this._UUID = Me.uuid; @@ -75,7 +79,7 @@ export class DesktopIconsUsableAreaClass { // If an extension is being enabled and lacks the // DesktopIconsUsableArea object, we can avoid launching a refresh - if (extension.state === ExtensionUtils.ExtensionState.ENABLED) { + if (this._checkIfExtensionIsEnabled(extension)) { this._sendMarginsToExtension(extension); return; } @@ -153,8 +157,7 @@ export class DesktopIconsUsableAreaClass { _sendMarginsToExtension(extension) { // check that the extension is an extension that has the logic to accept // working margins - if ((extension?.state !== ExtensionUtils.ExtensionState.ENABLED) && - (extension?.state !== ExtensionUtils.ExtensionState.ACTIVE)) + if (!this._checkIfExtensionIsEnabled(extension)) return; const usableArea = extension?.stateObj?.DesktopIconsUsableArea; From 926aef0caecfb2c43704712bd3225d9edc804362 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Thu, 16 May 2024 15:32:24 +0200 Subject: [PATCH 3/3] Fix style --- desktopIconsIntegration.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktopIconsIntegration.js b/desktopIconsIntegration.js index c1d46773a..ca0774732 100644 --- a/desktopIconsIntegration.js +++ b/desktopIconsIntegration.js @@ -64,7 +64,8 @@ const IDENTIFIER_UUID = '130cbc66-235c-4bd6-8571-98d2d8bba5e2'; export class DesktopIconsUsableAreaClass { _checkIfExtensionIsEnabled(extension) { - return ((extension?.state === ExtensionUtils.ExtensionState.ENABLED) || (extension?.state === ExtensionUtils.ExtensionState.ACTIVE)); + return (extension?.state === ExtensionUtils.ExtensionState.ENABLED) || + (extension?.state === ExtensionUtils.ExtensionState.ACTIVE); } constructor() {