sway
sway copied to clipboard
if a for_window rule is to kill the window, a tiled area is still created, causing windows to move out of place for one frame
right now I have a for window rule
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] floating enable; kill
If I remove floating enable part, tiled windows move around for one frame, this is slightly janky, and it's weird that floating enable would fix that.
Unsure if this is worth fixing in code, mostly sharing my solution in case anyone else is annoyed by this.
For what it's worth, in my testing, successive for_window calls seem to be calculated frame by frame, not all at once. As a result, windows affected by multiple for_window calls can, for example, be made floating and then tiling, or the opposite. This causes windows to move around. The behavior can be reproduced by toggling floating for one window (on, then off) in a screen of tiling windows.
My solution is to only have one for_window call in my sway config. Example, which makes everything float except for the windows that I have designated in the negative lookaround:
for_window [\
class="^(?!Signal|Spotify|discord$).*$"\
app_id="^(?!pavucontrol|Alacritty|com.obsproject.Studio|firefox-nightly$).*$"\
] floating enable
This style of "everything floats except for core applications that tile well" serves my purposes.