Skip to content

input: add live pinch cursor zoom #14049

Open
barrettruth wants to merge 1 commit intohyprwm:mainfrom
barrettruth:input/live-pinch-cursor-zoom
Open

input: add live pinch cursor zoom #14049
barrettruth wants to merge 1 commit intohyprwm:mainfrom
barrettruth:input/live-pinch-cursor-zoom

Conversation

@barrettruth
Copy link
Copy Markdown
Contributor

@barrettruth barrettruth commented Apr 11, 2026

Describe your PR, what does it fix/add?

Adds a live pinch mode for cursorZoom. This is the typical continual "zoom" gesture
behavior one expects in windows/macos.

As of this PR cursorZoom only supports toggle/mult-style behavior. This patch adds a continual zoom mode according to the pinch scale, keeping the zoom anchored to the initial cursor pos. I found this to most similarly imitate macos/windows zoom.

Lastly, I augmented tests by restoring the cursor position after the new gesture block because this was leaking state into the new tests that I added.

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

  1. The live name of the zoom mode in the gesture config. Perhaps something more
    intuitive would be better.
  2. Live pinch currently snaps values below 1.05x back to 1.0x instead of leaving the monitor at tiny residual zoom levels like 1.01x. I did this to avoid touchpad jitter leaving cursor zoom on. I low key just made up the threshold of 1.05 and found that it generally works ok. Would like additional testing/considerations from others.

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

r4r.

@github-actions
Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

Comment thread hyprtester/plugin/src/main.cpp Outdated
@barrettruth barrettruth force-pushed the input/live-pinch-cursor-zoom branch from fbdd9b0 to 753f4f8 Compare April 12, 2026 19:56
Comment thread hyprtester/plugin/src/main.cpp Outdated
@barrettruth barrettruth force-pushed the input/live-pinch-cursor-zoom branch from 753f4f8 to 5e3763b Compare April 15, 2026 22:37
@barrettruth barrettruth requested a review from vaxerski April 15, 2026 22:39
vaxerski
vaxerski previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
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.

lgtv wiki mr needed

@barrettruth
Copy link
Copy Markdown
Contributor Author

done, thanks for your patience - i know that you're being inundated with prs

this was interesting to explore and also a feature i think is really valuable. hopefully there are minimal bugs with it in the future... (lol)

will continue to help out on hyprland!

@vaxerski
Copy link
Copy Markdown
Member

you good it's my job

@vaxerski
Copy link
Copy Markdown
Member

some tests are failing

@barrettruth
Copy link
Copy Markdown
Contributor Author

fixed sorry for delay

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.

2 participants