avahe-kellenberger / nimdow

A window manager written in Nim (In Development)
GNU General Public License v2.0
317 stars 19 forks source link

PiMo layout algorithm #227

Open PMunch opened 6 months ago

PMunch commented 6 months ago

This is based directly off-of the layoutrework branch, so you can go ahead and merge that first and this becomes four commits.

Adds Nimdows first alternative layout, PiMo! PiMo is a non-overlapping window management strategy, similar to tiling window managers but respecting the size requested by the window (or controlled via app rules). Windows are laid out where there is room for them, trying to minimize how much other windows have to change their size. Moving windows around with left/right/up/down movements also tries to be as intuitive as possible. In addition to moving windows, making them float, and making them fullscreen PiMo also supports a couple more actions. Namely "expand X" and "expand Y", these basically tells the window manager that this window should attempt to be as large as possible in the X and/or Y directions. If an app rule is applied to all windows enabling both expansions the experience is similar to that of a tiling window manager, although PiMo will scale the available space based on the windows initial request. This means that if a large window like a browser is put next to a small window like a terminal then the browser will get more than 50% of the available width and the terminal will get slightly less.

Currently this should be in a useable state, however it is missing resizing options at the moment (these are very simple to implement, simply set the requested size and reshuffle the windows). I'm making this PR because I'm likely going to be away for about a week and I figured someone might want to try this out.

avahe-kellenberger commented 6 months ago

I think it's missing pimo/areatools (in layouts/pimo.nim)

PMunch commented 6 months ago

Ah crap, you do indeed. I might be able to fix it tomorrow evening