From d2d8b0e34f25e2ff4acd6ae79c827703b4fbcf89 Mon Sep 17 00:00:00 2001 From: Saman Shirdel Date: Thu, 22 Oct 2026 14:50:42 +0330 Subject: [PATCH 1/2] Fix dock review findings Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- default/i18n/en/shell.json | 2 ++ shell/plugins/dock/Dock.qml | 22 ++++++++++++---------- shell/plugins/dock/DockWindow.qml | 9 +++++++++ shell/services/AppLibrary.qml | 8 +++++++- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/default/i18n/en/shell.json b/default/i18n/en/shell.json index 7a5daf27432d..b0177bcff8df 100644 --- a/default/i18n/en/shell.json +++ b/default/i18n/en/shell.json @@ -207,8 +207,10 @@ "diskSpeedtest.failed": "Disk speed test failed", "diskSpeedtest.read": "READ", "diskSpeedtest.write": "WRITE", + "dock.apps": "Apps", "dock.autoHide": "Auto-hide", "dock.keepInDock": "Keep in Dock", + "dock.minimize": "Minimize", "dock.newWindow": "New Window", "dock.noAppsMatch": "No apps match “%1”", "dock.open": "Open", diff --git a/shell/plugins/dock/Dock.qml b/shell/plugins/dock/Dock.qml index 323bd3dfba96..1d21d119bcf5 100644 --- a/shell/plugins/dock/Dock.qml +++ b/shell/plugins/dock/Dock.qml @@ -176,12 +176,10 @@ Item { root.launches = next } - // Opens one more window of an app, which may already be running. The app - // library's launcher can answer a running app by focusing it, so this runs - // the entry itself: its own "new window" action when it has one, otherwise - // its Exec line, which for single-instance apps such as Files is what asks - // the running instance for a window. An app that has to run in a terminal - // still goes through the library, which knows how to open one. + // Opens one more window of an app, which may already be running. Use its + // "new window" action when it has one, otherwise its Exec line, which for + // single-instance apps such as Files asks the running instance for a window. + // Both run in the app's own UWSM scope. function newWindow(item) { var entry = entryFor(item) if (!entry) return @@ -190,13 +188,13 @@ Item { var actions = entry.actions || [] for (var i = 0; i < actions.length; i++) { var action = actions[i] - if (action && /^new[-_ ]?window$/i.test(String(action.id || "")) && typeof action.execute === "function") { - action.execute() + if (action && /^new[-_ ]?window$/i.test(String(action.id || "")) && action.command && action.command.length > 0) { + if (root.appLibrary) root.appLibrary.launchCommand(action.command) return } } - if (!entry.runInTerminal && entry.command && entry.command.length > 0 && typeof entry.execute === "function") entry.execute() + if (!entry.runInTerminal && entry.command && entry.command.length > 0 && root.appLibrary) root.appLibrary.launchCommand(entry.command) else root.launchEntry(entry) } @@ -236,9 +234,13 @@ Item { // Every window of the app that is in view. function minimize(item) { if (!item) return + var monitor = Hyprland.focusedMonitor + var workspaceId = monitor && monitor.activeWorkspace ? monitor.activeWorkspace.id : -1 + if (!(workspaceId >= 1)) return var commands = [] for (var i = 0; i < item.windows.length; i++) { - var address = item.windows[i].minimized ? "" : root.hexAddress(item.windows[i]) + var window = item.windows[i] + var address = !window.minimized && window.workspaceId === workspaceId ? root.hexAddress(window) : "" if (address) commands.push("omarchy-hyprland-window-minimize " + Util.shellQuote(address)) } if (commands.length > 0) Util.execDetached(commands.join("; ")) diff --git a/shell/plugins/dock/DockWindow.qml b/shell/plugins/dock/DockWindow.qml index ef65ea32255b..78723bcded2a 100644 --- a/shell/plugins/dock/DockWindow.qml +++ b/shell/plugins/dock/DockWindow.qml @@ -818,12 +818,21 @@ PanelWindow { spacing: Style.spacing.sm Text { + id: tipHeading textFormat: Text.PlainText text: tip.lastSlot ? tip.lastSlot.tip : "" color: Commons.Color.tooltip.text font.family: Style.font.family font.pixelSize: Style.font.bodySmall font.bold: tip.previewing + elide: Text.ElideRight + } + + Binding { + target: tipHeading + property: "width" + value: Math.max(0, window.popupRoom - tip.contentLeftInset - tip.contentRightInset) + when: window.vertical } Grid { diff --git a/shell/services/AppLibrary.qml b/shell/services/AppLibrary.qml index 66f399f52777..c26331f2529a 100644 --- a/shell/services/AppLibrary.qml +++ b/shell/services/AppLibrary.qml @@ -90,7 +90,13 @@ Item { // inherit wayland-wm@.service. Keeping gtk-launch as the desktop-entry // resolver supports IDs with spaces and entries that UWSM rejects. // Keep the .desktop suffix or ids like org.telegram.desktop won't resolve. - Util.execDetached("uwsm-app -- gtk-launch " + Util.shellQuote(id + ".desktop")) + root.launchCommand(["gtk-launch", id + ".desktop"]) + } + + function launchCommand(command) { + var words = (command || []).filter(function(word) { return !/^%[a-zA-Z]$/.test(String(word)) }) + if (words.length === 0) return + Util.execDetached("uwsm-app -- " + words.map(function(word) { return Util.shellQuote(word) }).join(" ")) } // The command a terminal entry runs, without the field codes it leaves for a From 48d40d9308d962063a02f0699a7b399263855e1c Mon Sep 17 00:00:00 2001 From: Saman Shirdel Date: Thu, 22 Oct 2026 15:00:03 +0330 Subject: [PATCH 2/2] Align minimize menu with active workspace Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- shell/plugins/dock/Dock.qml | 8 ++++++-- shell/plugins/dock/DockWindow.qml | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/shell/plugins/dock/Dock.qml b/shell/plugins/dock/Dock.qml index 1d21d119bcf5..cf5e8d758f26 100644 --- a/shell/plugins/dock/Dock.qml +++ b/shell/plugins/dock/Dock.qml @@ -231,11 +231,15 @@ Item { Util.execDetached("omarchy-hyprland-window-minimize " + Util.shellQuote(address)) } + function minimizeWorkspaceId() { + var monitor = Hyprland.focusedMonitor + return monitor && monitor.activeWorkspace ? monitor.activeWorkspace.id : -1 + } + // Every window of the app that is in view. function minimize(item) { if (!item) return - var monitor = Hyprland.focusedMonitor - var workspaceId = monitor && monitor.activeWorkspace ? monitor.activeWorkspace.id : -1 + var workspaceId = root.minimizeWorkspaceId() if (!(workspaceId >= 1)) return var commands = [] for (var i = 0; i < item.windows.length; i++) { diff --git a/shell/plugins/dock/DockWindow.qml b/shell/plugins/dock/DockWindow.qml index 78723bcded2a..8d727a87028d 100644 --- a/shell/plugins/dock/DockWindow.qml +++ b/shell/plugins/dock/DockWindow.qml @@ -961,7 +961,9 @@ PanelWindow { readonly property var item: window.menuItem readonly property bool hasEntry: !!item && !!window.dock && !!window.dock.entryFor(item) readonly property bool running: !!item && item.windows.length > 0 - readonly property bool inView: !!item && item.windows.some(function(other) { return !other.minimized }) + readonly property bool inView: !!item && !!window.dock && item.windows.some(function(other) { + return !other.minimized && other.workspaceId === window.dock.minimizeWorkspaceId() + }) visible: window.contentShown && (!!item || window.settingsMenu) width: Math.max(Style.space(140), menuColumn.implicitWidth) + padding * 2