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 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc0ae50b95
commit
aecee213f8
2 files changed
+11
-1
No files matched your search
@@ -373,7 +373,7 @@ PanelWindow {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ShellState.overviewOpen = false;
|
ShellState.overviewOpen = false;
|
||||||
HyprlandService.focusWindow(tile.win.address);
|
HyprlandService.revealWindow(tile.win.address, slot.workspaceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ Singleton {
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
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) {
|
function focusWorkspace(id) {
|
||||||
if (!Number.isInteger(id) || id < 1)
|
if (!Number.isInteger(id) || id < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user