-
Notifications
You must be signed in to change notification settings - Fork 5.6k
gpui: Add "swipe to navigate" for macOS #36574
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
base: main
Are you sure you want to change the base?
Conversation
01ff86d
to
c0e1781
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Implements swipe gesture navigation for macOS, allowing users to navigate tabs using horizontal swipe gestures on trackpads. This feature maps left swipe to "pane::GoBack" and right swipe to "pane::GoForward" actions.
- Adds touchpad gesture support infrastructure with
TouchPadGestureEvent
andSwipeDirection
types - Converts macOS swipe events from mouse navigation simulation to proper touchpad gesture events
- Implements swipe-to-action mapping in the window event dispatcher
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
crates/gpui/src/interactive.rs | Adds touchpad gesture event types and platform input handling |
crates/gpui/src/platform/mac/events.rs | Converts macOS swipe events to touchpad gestures instead of mouse navigation |
crates/gpui/src/window.rs | Implements swipe gesture event dispatching and action mapping |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
d51edbd
to
baf8960
Compare
7eafc45
to
9f2482e
Compare
9f2482e
to
07da552
Compare
Fixed formatting issues with imports. |
dd8a5ac
to
bbc2238
Compare
bbc2238
to
654ff14
Compare
@ConradIrwin Any chance you can take a look at this now? It's been more than six weeks now. |
0c62a4e
to
34fd549
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
Please add or modify a GPUI example to demonstrate this touch behavior, so that we can test this :)
Release Notes: - Introduced swipe gestures for navigation on macOS.
34fd549
to
472beac
Compare
I'm a bit confused here, are you saying you're currently unable to test it as is? |
✅ separate examples make it easy to test how features look and feel, and are the primary way they're developed and documented in GPUI right now. See the window_positioning example, for example! :D |
Yeah but this is a feature for Zed, not the I would have to put a large portion of Zed, more specifically |
Actually, I think I got it. One sec. |
Closes #4954
Replaces #14939
Release Notes:
Added:
Requires these macOS settings:

Older macOS settings:

Note:
I altered the logic from #23332 or more specifically, I hard-coded the values to match native macOS swiping. I don't have that exact mouse and software to try to see if it works with the new values.
Either way, mouse navigation with btn4/5 still works out of the box on macOS for most mouses.
Whatever custom software that mouse uses, it disguises itself as a swipe event, so hopefully it also matches the delta values of one.
Thinking of using config to register custom actions to send for either axis, while defaulting for tab navigation for horizontal, and disabled for vertical, but that would be a separate PR.
Something like
Release Notes: