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;