tudurom / windowchef

Window Chef is a stacking window manager that cooks windows with orders from the Waitron
https://tudorr.ro/software/windowchef/
ISC License
203 stars 14 forks source link

Add grid movement and resizing functions #64

Closed mtreca closed 4 years ago

mtreca commented 4 years ago

I would like to reopen PR #57.

It has been a year since I closed the original PR since the two grid-based operations I proposed could be implemented outside of windowchef with the help of wmutils, and it seemed good enough for me at the time.

After a year of using different window managers, namely windowchef, mwm (my fork of windowchef), fvwm, wmutils, cwm, awesome, qtile and bspwm, I am still struggling to settle on a wm for good mainly because none of these wms have grid operations baked-in by default. I considered several other options before opening this PR:

Since neither of these options seem to cut it, I would like to merge these two functions to windowchef's core. I have other cool grid operations in mind that could be easily be implemented if this PR is merged (notably increasing and decreasing grid size on all four sides simultaneously).

Of course I would like to know what other windowchef users think of these changes and if they would be interested in using these kind of operations. If no one is really interested I think I will stick with maintaining my own branch.

tudurom commented 4 years ago

This PR and its intentions look quite good to me. I have only one question: how do you set the width and height of the grid?

mtreca commented 4 years ago

These functions re-use existing grid properties set using waitron window_put_in_grid. If no grid properties exist on a window when calling these functions, they return immediatly without modifying the window's geometry.

Tudor Roman writes:

This PR and its intentions look quite good to me. I have only one question: how do you set the width and height of the grid?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mtreca commented 4 years ago

Done!

tudurom commented 4 years ago

Looks great! One last question: what happens to the gridded windows if you change the parameters of the grid?

mtreca commented 4 years ago

Do you mean if a window is in a 9x9 grid and it is changed to another value (eg. 5x5)? Then it should simply redraw the window in the new grid given that grid parameter can only be changed by put_window_in_grid.

tudurom commented 4 years ago

Looks legit then.

tudurom commented 4 years ago

@vxid I made this fix too: 059c4f9b212cde16cad8fcc315872eab38e2be74

mtreca commented 4 years ago

@tudurom Nice catch. I never monocle or maximize windows so I didn't test these cases properly.

tudurom commented 4 years ago

it's not about monocling or maximizing, but just moving or resizing the window normally while in grid state.