Skip to content

input: add live pinch cursor zoom #14049

Merged
vaxerski merged 1 commit intohyprwm:mainfrom
barrettruth:input/live-pinch-cursor-zoom
May 1, 2026
Merged

input: add live pinch cursor zoom #14049
vaxerski merged 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

@vaxerski
Copy link
Copy Markdown
Member

pls wait for #13817

@barrettruth barrettruth force-pushed the input/live-pinch-cursor-zoom branch from 13203fc to 3b48b5e Compare April 28, 2026 22:59
@barrettruth
Copy link
Copy Markdown
Contributor Author

@vaxerski sorry for the bother - see you've been shipping a lot of great feautres.

This branch is ready - wiki too! :D

Comment thread hyprtester/plugin/src/main.cpp Outdated
Comment thread hyprtester/src/tests/main/groups.cpp
@barrettruth barrettruth force-pushed the input/live-pinch-cursor-zoom branch from 3b48b5e to ee6e4b4 Compare April 30, 2026 18:18
@vaxerski
Copy link
Copy Markdown
Member

you regress tests (pointer tests are wonky but I see 3 fails not 2

@barrettruth barrettruth force-pushed the input/live-pinch-cursor-zoom branch from ee6e4b4 to dff7315 Compare April 30, 2026 20:47
@barrettruth
Copy link
Copy Markdown
Contributor Author

fixed was b/c of recent lua changes (sry, was taking exam should've marked it as draft) but ready now

@vaxerski
Copy link
Copy Markdown
Member

vaxerski commented May 1, 2026

was taking exam should've marked it as draft

bro was submitting MRs during the exam

@vaxerski vaxerski merged commit f972313 into hyprwm:main May 1, 2026
8 of 9 checks passed
@barrettruth barrettruth deleted the input/live-pinch-cursor-zoom branch May 2, 2026 15:52
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