From ab2a982bf0973668f444abfa40e624d2c0d0223e Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Mon, 16 Jun 2025 11:45:08 +0200 Subject: [PATCH] fix: Fixed context menu not updating when right clicking the workspace icon, b=no-bug, c=workspaces --- src/zen/workspaces/ZenWorkspaces.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 437928ae..a0772759 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -1167,7 +1167,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { } else { openInContainerMenuItem.setAttribute('hidden', 'true'); } - const target = event.explicitOriginalTarget?.closest('toolbarbutton'); + // Call parent node as on windows, the text can be double clicked + const target = event.explicitOriginalTarget?.parentNode?.closest('toolbarbutton'); this.#contextMenuData = { workspaceId: target?.getAttribute('zen-workspace-id'), originalTarget: target, @@ -1191,7 +1192,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { item.className = 'zen-workspace-context-menu-item'; item.setAttribute('zen-workspace-id', workspace.uuid); item.setAttribute('disabled', workspace.uuid === this.activeWorkspace); - item.setAttribute('label', (workspace.icon ?? ' \u25CB ') + ' ' + workspace.name); + let name = workspace.name; + if (workspace.icon && workspace.icon !== '') { + name = `${workspace.icon} ${name}`; + } + item.setAttribute('label', name); item.addEventListener('command', (e) => { this.changeWorkspaceWithID(e.target.closest('menuitem').getAttribute('zen-workspace-id')); });