From a3f37c23ce8f210b10c396922367f63f52ea0c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sun, 5 May 2024 18:23:44 +0200 Subject: [PATCH 1/9] locations: Ask again for password on encryption failures This sadly requires parsing the error strings since there are not good APIs yet, but that's how upstream handles this too, so let's accept it for now. See: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3300 --- locations.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/locations.js b/locations.js index bf20de8..85d71e2 100644 --- a/locations.js +++ b/locations.js @@ -656,6 +656,12 @@ class MountableVolumeAppInfo extends LocationAppInfo { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED)) this._notifyActionError(action, e.message); + if (action === 'mount' && this._isEncryptedMountError(e)) { + delete this._currentAction; + operation.close(); + return this.launchAction(action); + } + if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) { logError(e, 'Impossible to %s removable %s'.format(action, removable.get_name())); @@ -669,6 +675,39 @@ class MountableVolumeAppInfo extends LocationAppInfo { operation.close(); } } + + _isEncryptedMountError(error) { + // FIXME: we will always get G_IO_ERROR_FAILED from the gvfs udisks + // backend, see https://bugs.freedesktop.org/show_bug.cgi?id=51271 + + if (!error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED)) + return false; + + // cryptsetup + if (error.message.includes('No key available with this passphrase')) + return true; + + // udisks (no password) + if (error.message.includes('No key available to unlock device')) + return true; + + // libblockdev wrong password opening LUKS device + if (error.message.includes('Failed to activate device: Incorrect passphrase')) + return true; + + // cryptsetup returns EINVAL in many cases, including wrong TCRYPT password/parameters + if (error.message.includes('Failed to load device\'s parameters: Invalid argument') || + error.message.includes(`Failed to load device's parameters: ${GLib.strerror(22 /* EINVAL */)}`)) + return true; + + // cryptsetup returns EPERM when the TCRYPT header can't be decrypted + // with the provided password/parameters. + if (error.message.includes('Failed to load device\'s parameters: Operation not permitted') || + error.message.includes(`Failed to load device's parameters: ${GLib.strerror(1 /* EPERM */)}`)) + return true; + + return false; + } }); const TrashAppInfo = GObject.registerClass({ -- 2.45.2 From 57c0ce0021541b24ba857ff9c1dee5c930cfcd1e Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Sun, 12 May 2024 20:53:17 +0200 Subject: [PATCH 2/9] 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 e637501..6412a87 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; -- 2.45.2 From e37e32519578d300d00bb49308c831171fd2ad26 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Thu, 16 May 2024 15:30:00 +0200 Subject: [PATCH 3/9] Apply changes in all cases --- desktopIconsIntegration.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktopIconsIntegration.js b/desktopIconsIntegration.js index 6412a87..c1d4677 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; -- 2.45.2 From 28e64a9b144ea52c5d941f603c6c4b591b976417 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Thu, 16 May 2024 15:32:24 +0200 Subject: [PATCH 4/9] Fix style --- desktopIconsIntegration.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktopIconsIntegration.js b/desktopIconsIntegration.js index c1d4677..ca07747 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() { -- 2.45.2 From 88a11606366f83a23898893b497d4861640b3de3 Mon Sep 17 00:00:00 2001 From: Sergio Costas Rodriguez Date: Mon, 24 Jun 2024 17:38:46 +0200 Subject: [PATCH 5/9] Don't show error messages when disabling Since the destroy() function can be called several times, it is paramount to don't call objects that have been freed in previous calls. --- docking.js | 2 +- notificationsMonitor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docking.js b/docking.js index 23ffd34..fc60768 100644 --- a/docking.js +++ b/docking.js @@ -2551,7 +2551,7 @@ export class DockManager { this._appSwitcherSettings = null; this._oldDash = null; - this._desktopIconsUsableArea.destroy(); + this._desktopIconsUsableArea?.destroy(); this._desktopIconsUsableArea = null; this._extension = null; DockManager._singleton = null; diff --git a/notificationsMonitor.js b/notificationsMonitor.js index c9060e1..c8b4088 100644 --- a/notificationsMonitor.js +++ b/notificationsMonitor.js @@ -50,7 +50,7 @@ export class NotificationsMonitor { destroy() { this.emit('destroy'); - this._signalsHandler.destroy(); + this._signalsHandler?.destroy(); this._signalsHandler = null; this._appNotifications = null; this._settings = null; -- 2.45.2 From 55f8310f4f9d19e4fef90df82b3cf6d8a1cf8e0a Mon Sep 17 00:00:00 2001 From: Sergio Costas Date: Mon, 1 Jul 2024 05:23:40 +0200 Subject: [PATCH 6/9] UDENG-3111: allow to disable an icon in the dock during updates (#2240) * UDENG-3111: allow to disable an icon in the dock during updates For the new RAA we need to be able to mark an icon as "disabled" while it is being updated. The current Unity LauncherAPI (https://wiki.ubuntu.com/Unity/LauncherAPI) doesn't support this, so this patch adds an extra option for this. https://docs.google.com/document/d/1--DgBRl6AqNiyjW_luOjl1dDzsIZPlF0Ukc7INW9_XQ --- appIconIndicators.js | 9 +++++++++ appIcons.js | 11 +++++++++++ launcherAPI.js | 1 + 3 files changed, 21 insertions(+) diff --git a/appIconIndicators.js b/appIconIndicators.js index e38510d..448b76b 100644 --- a/appIconIndicators.js +++ b/appIconIndicators.js @@ -739,6 +739,10 @@ class UnityIndicator extends IndicatorBase { remoteEntry, 'urgent-changed', (sender, {urgent}) => this.setUrgent(urgent), + ], [ + remoteEntry, + 'updating-changed', + (sender, {updating}) => this.setUpdating(updating), ], [ notificationsMonitor, 'changed', @@ -759,6 +763,7 @@ class UnityIndicator extends IndicatorBase { this._notificationBadgeBin = null; this._hideProgressOverlay(); this.setUrgent(false); + this.setUpdating(false); this._remoteEntry = null; super.destroy(); @@ -1018,6 +1023,10 @@ class UnityIndicator extends IndicatorBase { else delete this._isUrgent; } + + setUpdating(updating) { + this._source.updating = updating; + } } diff --git a/appIcons.js b/appIcons.js index 3c66c8e..b06aa02 100644 --- a/appIcons.js +++ b/appIcons.js @@ -106,6 +106,10 @@ const DockAbstractAppIcon = GObject.registerClass({ 'urgent', 'urgent', 'urgent', GObject.ParamFlags.READWRITE, false), + 'updating': GObject.ParamSpec.boolean( + 'updating', 'updating', 'updating', + GObject.ParamFlags.READWRITE, + false), 'windows-count': GObject.ParamSpec.uint( 'windows-count', 'windows-count', 'windows-count', GObject.ParamFlags.READWRITE, @@ -187,6 +191,13 @@ const DockAbstractAppIcon = GObject.registerClass({ } }); + this.connect('notify::updating', () => { + const icon = this.icon._iconBin; + if (this.updating) + icon.set_opacity(128); + else + icon.set_opacity(255); + }); this._urgentWindows = new Set(); this._progressOverlayArea = null; this._progress = 0; diff --git a/launcherAPI.js b/launcherAPI.js index cf08c38..e4e1c11 100644 --- a/launcherAPI.js +++ b/launcherAPI.js @@ -160,6 +160,7 @@ const launcherEntryDefaults = Object.freeze({ count: 0, progress: 0, urgent: false, + updating: false, quicklist: null, 'count-visible': false, 'progress-visible': false, -- 2.45.2 From 9270a6e723b40ce5cd8403aae0e2a2268f405a7c Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Tue, 28 May 2024 17:05:58 +0800 Subject: [PATCH 7/9] docking: Fix allocation failure in GNOME 47 that completely broke the shell Since this._container no longer exists (gnome-shell@b58119d5c6?) in GNOME 47, allocating the entire overview would fail and the shell was non-functional. Fixes: ``` Gjs-CRITICAL **: 17:10:01.720: JS ERROR: TypeError: actor is undefined findIndexForActor@resource:///org/gnome/shell/ui/layout.js:992:22 findMonitorForActor@resource:///org/gnome/shell/ui/layout.js:999:26 _prepareMainDash/<@file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js:2233:52 @resource:///org/gnome/shell/ui/init.js:21:20 ``` --- docking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docking.js b/docking.js index fc60768..531aed6 100644 --- a/docking.js +++ b/docking.js @@ -2230,7 +2230,7 @@ export class DockManager { const oldPostAllocation = this._runPostAllocation; this._runPostAllocation = () => {}; - const monitor = Main.layoutManager.findMonitorForActor(this._container); + const monitor = Main.layoutManager.findMonitorForActor(container); const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor.index); const startX = workArea.x - monitor.x; const startY = workArea.y - monitor.y; -- 2.45.2 From ec21858636fd4488893c0caa2c810bc3e1d345b1 Mon Sep 17 00:00:00 2001 From: Andrew Skalski <2379988+Voltara@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:41:29 -0400 Subject: [PATCH 8/9] Fix window selected from preview not getting focus Fixes #1972 --- windowPreview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windowPreview.js b/windowPreview.js index 75459b5..2e939af 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -645,8 +645,8 @@ class WindowPreviewMenuItem extends PopupMenu.PopupBaseMenuItem { } activate() { - this._getTopMenu().close(); Main.activateWindow(this._window); + this._getTopMenu().close(); } _onDestroy() { -- 2.45.2 From dd35fb149050c412278c4db3dc4e6e40bff78d76 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 5 Jul 2024 12:05:06 +0800 Subject: [PATCH 9/9] metadata.json: Enable support for gnome-shell 47 (#2248) Closes: https://github.com/micheleg/dash-to-dock/issues/2246 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index f205087..1e99ff2 100644 --- a/metadata.json +++ b/metadata.json @@ -1,7 +1,8 @@ { "shell-version": [ "45", - "46" + "46", + "47" ], "uuid": "dash-to-dock@micxgx.gmail.com", "name": "Dash to Dock", -- 2.45.2