Implement layout sticky for floating windows#2083
Conversation
|
I have tested this branch with a local debug build and it works. However, I have one small suggestion: Most of the time, the windows that need sticky, are also already started as floating. So, I would suggest that macWindow.isSticky when used to match a window using [[on-window-detected]], only applies sticky to windows of that app that are floating. Otherwise if you have multiple windows of the same app, but some aren't floating, it applies to all. Other than that, this works awesomely. |
2dc78b5 to
803164a
Compare
|
Perfect, now I can do: [[on-window-detected]] And the AeroSpace automatically applies sticky to any floating window from that app. @nikitabobko What does this PR need to get in? Tests? |
Adds a `sticky` layout subcommand that toggles a per-window `isSticky` flag. Sticky floating windows stay visible on non-visible workspaces (unhidden from the corner) and aren't auto-refocused away by the focus cache when they live on a different workspace than the focused one. Adds parse tests for the new `sticky` layout subcommand. Ports nikitabobko#2083 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
803164a to
7b01b37
Compare
Sticky floating windows remain visible across all workspace switches without following the active workspace. Clicking a sticky window does not trigger a workspace switch. Implementation: - Add .sticky case to LayoutDescription enum in LayoutCmdArgs - Add isSticky property to MacWindow - In LayoutCommand: applying .sticky auto-floats the window and sets isSticky = true; applying any other layout clears isSticky - In layoutWorkspaces() in refresh.swift: skip hideInCorner for sticky windows, and explicitly unhide them after visible workspaces are laid out - In updateFocusCache(): prevent workspace switching when a sticky window receives native focus Usage: layout sticky # toggle sticky (auto-floats if needed) layout sticky tiling # toggle between sticky-float and tiling Closes nikitabobko#2
7b01b37 to
4394146
Compare
See commit message for details.
PR checklist
./test.shexits with non-zero exit code.Failure to follow the checklist with no apparent reasons will result in silent PR rejection.