Skip to content

Commit

Permalink
Fix communication with DING
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sergio-costas authored and vanvugt committed Jun 10, 2024
1 parent fffca04 commit 8004637
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions desktopIconsIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ 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;
Expand All @@ -75,7 +80,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;
}
Expand Down Expand Up @@ -153,7 +158,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)
if (!this._checkIfExtensionIsEnabled(extension))
return;

const usableArea = extension?.stateObj?.DesktopIconsUsableArea;
Expand Down

0 comments on commit 8004637

Please sign in to comment.