Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable directional window resize logic #6571

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Agent00Ming
Copy link
Contributor

@Agent00Ming Agent00Ming commented Jun 17, 2024

Describe your PR, what does it fix/add?

Closes #6152, adds a drop-in replacement (and configurable) window resizing logic. Also will fix a bug with pseudotiled windows + resize on border being unreliable (sometimes resizes the node box, sometimes resizes the inner window).

New function: IHyprLayout::getWindowRegion() determines where a point is on an arbitrary rectangle defined as a CBox with an optional CBox for edge size calculation (defaults to 0) and an optional raw boolean for the raw untranslated integer. Returns an integer between 0 and 23 (inclusive) when translated in-function.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Drop-in compatibility, no behavioural changes unless configured to be. Pseudotiled general:resize_on_border interaction now always resizes the inner window instead of the window node's box.

general:edge_depth float value that

  • acts as a % of the window's shortest side divided into two edges when between 0.0 and 1.0 (exclusive)
  • acts as a pixel count clamped between 1 and 1/2 of the window's shortest side when above 1.0
  • disables the calculation of edges when 0 or under.

general:resize_mouse_bind_pattern integer value that sets the pattern of the window resize direction.

  • 0 is the default, the 4 corners that we have now.
  • 1 makes the edges of the window single axis resize and the middle of the window is divided into 4 corners.
  • 2 is similar to the default with the exception that the edges are single axis resize
  • 3 corners do the dual axis resize and a 'cross' shape that connects the edges are single axis resize
  • 4 window is divided into 4 triangles for single axis resizes only
  • Any invalid value is considered default

Is it ready for merging, or does it need work?

It's presently in a working state for dwindle and for floating windows.

TODO:

  • floating windows don't update their reported size and position when resized (bug in main branch)
  • general:extend_border_grab_area no longer does anything (bug in main branch) (broken by addd3e7)
  • pseudotiled windows [dwindle] have a inconsistent general:resize_on_border interaction (bug in main branch)
  • pseudotiled windows [dwindle] don't respect single axis resize
  • master layout does not respect single axis resize
  • primary + alternate pattern ?
  • settle on config variable names
  • cleanup
  • docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bind or setting to precisely resize a window with a pointing device
1 participant