Commit d1954ca
committed
fix: prevent floating windows from getting stuck in corner after workspace switch
When AeroSpace hides windows from inactive workspaces, it moves them to a
screen corner and saves their previous position so they can be restored later
(unhideFromCorner). A race condition with AX notifications could cause the
following broken cycle:
1. hideInCorner() saves the normal position, moves window to corner
2. unhideFromCorner() restores it, clears prevUnhiddenProportionalPosition
3. A spurious AX event triggers unhideFromCorner() again — no-op since
prevUnhiddenProportionalPosition is already nil, window stays in place
4. Next workspace switch calls hideInCorner() again — isHiddenInCorner is
false (nil check) — so it saves the *current* position, which is already
the corner position
5. unhideFromCorner() then restores the window to the corner → stuck forever
Fix: in hideInCorner(), only record the window's position when its top-left
corner is actually inside the monitor's visible rect. If it's already outside
(stuck in a corner from a previous broken cycle), skip saving to avoid
permanently anchoring it to the corner.
Fixes: #18751 parent 8134ad0 commit d1954ca
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
| |||
0 commit comments