Skip to content

gpui: Support Force Touch go-to-definition on macOS#40399

Merged
as-cii merged 12 commits intozed-industries:mainfrom
aarol:force-touch
Dec 15, 2025
Merged

gpui: Support Force Touch go-to-definition on macOS#40399
as-cii merged 12 commits intozed-industries:mainfrom
aarol:force-touch

Conversation

@aarol
Copy link
Contributor

@aarol aarol commented Oct 16, 2025

Closes #4644

Release Notes:

  • Adds MousePressureEvent, an event that is sent anytime the touchpad pressure changes, into gpui. MacOS only.
  • Triggers go-to-defintion on force clicks in the editor.

This is my first contribution, let me know if I've missed something here.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 16, 2025
Copy link
Member

@mikayla-maki mikayla-maki left a comment

Choose a reason for hiding this comment

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

Great work on this PR, love the editor test!

Can you create a small GPUI example, call it "events.rs" say, that just opens a window and prints out the pressure events that are received?

@aarol
Copy link
Contributor Author

aarol commented Nov 9, 2025

I've added a small example for testing mouse pressure into examples.

I wasn't able to figure out how to listen to the mouse pressure event from main(), so I added on_mouse_pressure() the the div element since all other mouse events also have callbacks on it.

Let me know if these changes are sufficient!

@Anthony-Eid Anthony-Eid changed the title Support Force Touch go-to-definition on macOS gpui: Support Force Touch go-to-definition on macOS Nov 14, 2025
@Anthony-Eid Anthony-Eid moved this to To Review in GPUI Roadmap Nov 14, 2025
@franciskafyi franciskafyi assigned as-cii and unassigned Anthony-Eid Dec 13, 2025
Resolved import conflict in editor.rs by keeping both PressureStage
(from force-touch) and TextRun (from main).
@as-cii
Copy link
Member

as-cii commented Dec 15, 2025

Code looks reasonable and I tested it manually, and it seems to work correctly. Queuing up for merging, thanks!

@as-cii as-cii enabled auto-merge (squash) December 15, 2025 13:49
@as-cii as-cii dismissed mikayla-maki’s stale review December 15, 2025 14:03

The example was added.

@as-cii as-cii merged commit 07bf685 into zed-industries:main Dec 15, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from Community PRs to Done in Quality Week – December 2025 Dec 15, 2025
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
…0399)

Closes zed-industries#4644

Release Notes:

- Adds `MousePressureEvent`, an event that is sent anytime the touchpad
pressure changes, into `gpui`. MacOS only.
- Triggers go-to-defintion on force clicks in the editor.

This is my first contribution, let me know if I've missed something
here.

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
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

Development

Successfully merging this pull request may close these issues.

Force Click for definition

4 participants