i3 icon indicating copy to clipboard operation
i3 copied to clipboard

1412 bspwm resize

Open cmprmsd opened this issue 3 years ago • 4 comments

Trying to rebase and fix @xzfc pull request https://github.com/i3/i3/pull/3545

original message: bspwm-like tiling resize

  • Two-axis tiling resize. You can drag a 24-pixel window corner (purple) to perform a two-axis resize. Also, you can press Mod and drag a large corner inside the window (one-third of the window size). illustration

  • Live resize: the tree is rendered during the resize process.

  • You can still press ESC to cancel resizing and revert to the old state.

  • Introduced the concept of the minimum container size. E.g. the minimum width of leaf con with 10px borders is 21px (left border + right border + at least 1px for the window itself). The minimum size is defined recursively, e.g. the minimum height of the vsplit is the sum of minimum sizes of its children. The reason for this change: the live resize made it very easy to shrink containers as small as possible, so some restraints are required.

  • ~Misc update: ignore the drag if i3 can't perform the resize. Suppose the user tries to resize the rightmost window to the right using Mod+RMB drag. Obliviously, i3 can't do this. Before this PR, the drag has been propagated to the application (some apps would show a context menu). After this PR, the drag would be ignored at all (and the cursor would be shown as ✕). The reasoning behind this change: the user explicitly indicated their desire to resize the window by pressing the Mod key, and probably just miss clicked to the wrong part of the window.~ Done in 93e96f4.

  • Bugfix in tiling_resize(): you can now resize the window with pixel border by dragging the top border.

cmprmsd avatar Apr 22 '22 13:04 cmprmsd

Thanks for your comments! I'll have to look into them. I clearly am no developer but trying my best to understand how this could work out. 😅

Contributors are welcome. I guess that'll would mean inviting some people to this fork if there is anyone willing to try. :)

cmprmsd avatar Apr 25 '22 22:04 cmprmsd

I was waiting on feedback what has to be done to get this merged. I think I replied to everything. Help 😅

cmprmsd avatar Jul 21 '23 18:07 cmprmsd

Btw, I'm using this forked branch on 4.14 since a year now in virtual machines without any issues. Shall I rebase on the latest master branch to get this merged?

cmprmsd avatar Jul 21 '23 18:07 cmprmsd

Apologies for closing.

This branch does seem to have significant conflicts with next now though.

orestisfl avatar Jul 21 '23 18:07 orestisfl

@cmprmsd Do you intend to continue the work here? I can share a branch with resolved conficts wrt current head if that helps. I could technically pick up work as well, but I don't know the changes well (other than what I had to look at to resolve conflicts).

https://github.com/algmyr/i3/tree/bspwm_resize

(also squashed some of the fixups while poking at the code anyway, presumably the second commit shouldn't be merged into here)

I left a thing to verify in https://github.com/algmyr/i3/blob/bspwm_resize/src/resize.c#L240 since some code that contained later bug fixes ended up being removed during this change.

FWIW, on top of being a neat feature, this also fixes some really bad mouse resize lag I experienced. :)

algmyr avatar Jun 24 '24 23:06 algmyr

Hi @algmyr, Nice stuff, I was also just following up @xzfc work. I followed up on the issues @orestisfl mentioned but it never got past the current state. Feel free to take over. I'm using my outdated fork since than as I really like the feature. Will try your wip asap. 😬

cmprmsd avatar Jun 25 '24 02:06 cmprmsd