From aecee213f8ab45b07c7ef08ab0232d1268bb3007 Mon Sep 17 00:00:00 2001 From: mx Date: Thu, 12 Nov 2026 16:00:00 +0100 Subject: [PATCH] Switch to a clicked overview window's workspace Hyprland ignores activation requests for windows on other workspaces unless misc:focus_on_activate is set, so clicking a window preview did nothing. Dispatch the workspace and window focus instead. Co-Authored-By: Claude Opus 5.5 --- quickshell/overview/Overview.qml | 2 +- quickshell/services/HyprlandService.qml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/quickshell/overview/Overview.qml b/quickshell/overview/Overview.qml index 291d021..d440fa6 100644 --- a/quickshell/overview/Overview.qml +++ b/quickshell/overview/Overview.qml @@ -373,7 +373,7 @@ PanelWindow { return; } ShellState.overviewOpen = false; - HyprlandService.focusWindow(tile.win.address); + HyprlandService.revealWindow(tile.win.address, slot.workspaceId); } } } diff --git a/quickshell/services/HyprlandService.qml b/quickshell/services/HyprlandService.qml index 0fc4d9f..c2d1065 100644 --- a/quickshell/services/HyprlandService.qml +++ b/quickshell/services/HyprlandService.qml @@ -61,6 +61,16 @@ Singleton { return false; return true; } + // Goes to a window wherever it is. Activation requests (focusWindow) are + // ignored for windows on other workspaces unless misc:focus_on_activate is set. + function revealWindow(address, workspace) { + if (!/^(0x)?[0-9a-f]+$/i.test(address)) + return false; + if (Number.isInteger(workspace) && workspace > 0) + focusWorkspace(workspace); + Hyprland.dispatch("hl.dsp.focus({ window = 'address:" + (address.startsWith("0x") ? address : "0x" + address) + "' })"); + return true; + } function focusWorkspace(id) { if (!Number.isInteger(id) || id < 1) return false;