Cinnamon/Muffin: stacking-aware, multi-monitor free-space window placement mode #1684
Michael-1
started this conversation in
Pull requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Current behaviour
With
placement-modeautomatic,find_first_fit()in Muffin’ssrc/core/place.ctries three things, and only on the monitor Muffin picks for the window:A candidate is only accepted if it overlaps no other window at all. Otherwise the placement falls back to cascading. On a busy desktop that almost always means cascading, even when a large area is only covered by windows deep in the stack that you can barely see. It also never considers a second monitor that is empty.
Proposal
An opt-in placement mode (for example
free-space) for normal, non-transient windows. Dialogs and other transients keep the current behaviour, so they still open over their parent:The effect: a new window avoids the windows you can actually see (the top of the stack) and is allowed to cover windows that are buried anyway. Unlike first-fit, it doesn’t give up and cascade as soon as no completely empty spot exists.
Prototype
I’m running this as an external python-xlib daemon (Cinnamon 6.6.9 on X11) that moves windows right after Muffin maps them. To try it:
sudo apt install python3-xlib, then run the script in a session. The maximal-rectangle subtraction (subtract()) is simple and cheap enough to run insidemeta_window_place().smart-placement.py
I’m willing to port it to C in
place.cas a newMetaPlacementMode, plus the matchingorg.cinnamon.muffin placement-modeenum value and an entry in Cinnamon's window settings. The existing modes stay unchanged. Would you merge a PR along these lines?Related
linuxmint/cinnamon#4313 and linuxmint/cinnamon#542 introduced the current placement modes; linuxmint/muffin#205 and linuxmint/muffin#857 describe shortcomings of
automatic’s first-fit/cascade path.Environment
Linux Mint, Cinnamon 6.680
All reactions