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

Fix tablet mapping when mapped region is specified #6206

Merged
merged 1 commit into from
May 23, 2024

Conversation

sifmelcara
Copy link
Contributor

Describe your PR, what does it fix/add?

When region_position or region_size is set in the config (non-empty boundBox), cursor is mapped to wrong coordinate because CBox::translate mutates TAB->boundBox, making all subsequent coordinate calculations wrong.

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

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

Ready

@sifmelcara sifmelcara marked this pull request as draft May 23, 2024 04:53
@sifmelcara
Copy link
Contributor Author

Updated the commit to also account for the case where region_position is set but region_size is unset. (I doubt anyone would do this though)

Tested

  • Only set region_position
  • Only set region_size
  • Set both

with libwacom and multi monitor set-up; my input:tablet:output is set to a monitor that is not at (0, 0).

@sifmelcara sifmelcara marked this pull request as ready for review May 23, 2024 05:06
When `region_size` is set in the config (non-empty
`boundBox`), cursor is mapped to wrong coordinate because
`CBox::translate` mutates `TAB->boundBox`, making all subsequent coordinate
calculations wrong.

This also fixes the edge case where user sets `region_position` but
not `region_size`.
Copy link
Contributor

@Agent00Ming Agent00Ming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that this does indeed fix region size and position mapping defined inside of hyprland config.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@vaxerski vaxerski merged commit df80fbf into hyprwm:main May 23, 2024
8 of 10 checks passed
The-Briel-Deal pushed a commit to The-Briel-Deal/Hyprland that referenced this pull request May 25, 2024
When `region_size` is set in the config (non-empty
`boundBox`), cursor is mapped to wrong coordinate because
`CBox::translate` mutates `TAB->boundBox`, making all subsequent coordinate
calculations wrong.

This also fixes the edge case where user sets `region_position` but
not `region_size`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants