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 properties, movement and resizing #57

Closed mtreca closed 5 years ago

mtreca commented 5 years ago

Following issue #56

Note that it is my first time using C for a non-trivial project, so feel free to point out any mistakes I may have made.

Changes

Properties

I added grid properties on all windows:

Functions

Two new waitron functions:

These functions do not allow a window to go beyond the edges of the screen.

Both functions seem to work find so far (as in, I didn't find any bugs yet).

tudurom commented 5 years ago

I saw your issue and told myself that I will reply to it when I have the time, I'm busy with school. IMO I think that shipping your script with windowchef would be the better approach, it would also serve as an example for windowchef's capabilities. Now I feel sorry that you actually got to implement this in the wm itself ;). I checked the code and it seems good, you added the json properties too, great job. I didn't try neither the script nor this implementation, I don't know if there any advantages/disadvantages. With that said, I think that, if there are no disadvantages, this feature should not be shipped in the wm itself, but as a script. I hope you learned along the way of implementing this. Sorry for being late.

On Wed, 19 Sep 2018, 01:50 vxid, notifications@github.com wrote:

Following issue #56 https://github.com/tudurom/windowchef/issues/56

Note that it is my first time using C for a non-trivial project, so feel free to point out any mistakes I may have made. Changes Properties

I added grid properties on all windows:

  • state can now be "gridded"
  • grid dimensions, window position and size

Functions

Two new waitron functions:

  • window_resize_in_grid to resize windows with grid steps
  • window_move_in_grid to move a window with grid steps

These functions do not allow a window to go beyond the edges of the screen.

Both functions seem to work find so far (as in, I didn't find any bugs yet).

You can view, comment on, or merge this pull request online at:

https://github.com/tudurom/windowchef/pull/57 Commit Summary

  • Add grid properties, movements and resizing

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tudurom/windowchef/pull/57, or mute the thread https://github.com/notifications/unsubscribe-auth/AKNZTI7IXxUs7bC2nquSWZelsrWds4zTks5ucXjRgaJpZM4Wu97i .

tudurom commented 5 years ago

If this implementation has advantages that cannot be made into a script then I may change my mind.

mtreca commented 5 years ago

Thanks for the feedback.

The biggest advantage of not using a script right now is to limit the number of dependencies (wmutils, xprop, and the script itself) and improve performance (12 calls to xprop for a single movement or resize call in the script).

I agree that these advantages are a bit light so far, but I plan on implementing other grid based features (dynamically changing the grid size, other suggestions are welcome) that would incrementally benefit from being implemented in windowchef's core.

Of course the obvious drawback of putting this in core would be code bloat and the fact that a few people actually use this functionality.

Either way, feel free to merge or not, I'll keep this branch waiting. I'll post here if any other drawbacks or advantages come to mind.

Also, it was actually pretty fun working on windowchef's source. I don't know if you have a roadmap or todo list for the project, but I would be interested in contributing more regularly.