Skip to content

image_viewer: Add pinch event support#47351

Open
MostlyKIGuess wants to merge 15 commits intozed-industries:mainfrom
MostlyKIGuess:feature/gesture-pinch-support
Open

image_viewer: Add pinch event support#47351
MostlyKIGuess wants to merge 15 commits intozed-industries:mainfrom
MostlyKIGuess:feature/gesture-pinch-support

Conversation

@MostlyKIGuess
Copy link
Contributor

This change implements pinch / magnification gesture handling.

This uses the following wayland protocol. And the following API for mac.

Release Notes:

  • Zooming works with pinching in and out inside Image Viewer

- Add platform support for pinch gestures:
  - macOS: NSEventType::NSEventTypeMagnify
  - Wayland: zwp_pointer_gesture_pinch_v1 protocol
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 22, 2026
@MrSubidubi MrSubidubi assigned MrSubidubi and unassigned rgbkrk Jan 22, 2026
@MrSubidubi MrSubidubi changed the title repl: add gesture(pinch) event support image_viewer: Add pinch event support Jan 22, 2026
@olegKusov

This comment was marked as off-topic.

Copy link
Contributor

@agu-z agu-z left a comment

Choose a reason for hiding this comment

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

@MostlyKIGuess Thank you for your contribution. This is working well in my testing.

Before merging, I’d like to change the new GPUI methods to use [cfg(any(target_os = "linux", target_os = "macos"))] so consumers of the API are aware that this event isn’t available on Windows.

In the doc comments, we should also clarify that the event only works on macOS and Wayland, and explain how Windows simulates scroll wheel + Ctrl events on pinch.

In the future we may want to handle this complexity at the GPUI level, but I don’t think it’s a blocker as long as the API doesn’t suggest it should work when it won’t.

@MostlyKIGuess MostlyKIGuess requested a review from agu-z February 11, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants