Repository navigation
macos: reset mouse state on focus loss to prevent phantom drag - #11276
Merged
mitchellh merged 1 commit intoMar 10, 2026
Merged
Conversation
Member
|
CC @rockorager |
Contributor
|
I think this fixes #11319 too. |
Contributor
also lol. |
mitchellh
force-pushed
the
fix/macos-mouse-state-focus-reset
branch
from
March 10, 2026 16:49
74aa089 to
970542a
Compare
mitchellh
approved these changes
Mar 10, 2026
mitchellh
left a comment
Contributor
There was a problem hiding this comment.
Cleaned up some of the code with comments, removed the core surface changes. I don't think the core changes were necessary for this fix. If I'm wrong about that please let me know but I couldn't reproduce the bug anymore with just the apprt changes and I'm afraid the core changes may impact legitimate mouse release events in some cases.
Fixes phantom mouse drag/selection when switching splits or apps. The suppressNextLeftMouseUp flag and core mouse click_state were not being reset on focus transitions, causing stale state that led to unexpected drag behavior. - Reset suppressNextLeftMouseUp in focusDidChange when losing focus - Defensively reset the flag when processing normal clicks - Reset core mouse.click_state and left_click_count on focus loss
mitchellh
force-pushed
the
fix/macos-mouse-state-focus-reset
branch
from
March 10, 2026 16:54
970542a to
6092c29
Compare
Contributor
Author
|
Thank you! 🎉 |
|
I thought I was going a bit crazy and accidentally clicking. Thank you @seruman and @mitchellh for acting on this so quickly 🙇 |
Closed
8 tasks
greenheadHQ
added a commit
to greenheadHQ/nixos-config
that referenced
this pull request
Mar 12, 2026
포커스 전환 시 텍스트가 팬텀 드래그되며 무한 스크롤되는 1.3.0 회귀 버그. upstream PR ghostty-org/ghostty#11276 수정이 포함된 tip 채널로 전환. 1.3.1 stable 릴리스 후 "ghostty"로 복원 예정.
|
Thanks @seruman! This fixed a really annoying phantom drag issue I've been hitting. Much appreciated! |
whexy
added a commit
to whexy/dotfiles
that referenced
this pull request
Mar 17, 2026
Upstream located a bug ghostty-org/ghostty#11276 This commit uses stable channel again, which add a backport of the upgrade commit in unstable channel.
bo2themax
added a commit
to bo2themax/ghostty
that referenced
this pull request
Mar 19, 2026
It will fail on 4e24adf and success after ghostty-org#11276
mitchellh
added a commit
that referenced
this pull request
Mar 21, 2026
greenheadHQ
added a commit
to greenheadHQ/nixos-config
that referenced
this pull request
Jun 6, 2026
포커스 전환 시 텍스트가 팬텀 드래그되며 무한 스크롤되는 1.3.0 회귀 버그. upstream PR ghostty-org/ghostty#11276 수정이 포함된 tip 채널로 전환. 1.3.1 stable 릴리스 후 "ghostty"로 복원 예정.
jpnurmi
added a commit
to jpnurmi/limux
that referenced
this pull request
Jul 16, 2026
Cherry-picks upstream commit 0fa12f8 from manaflow-ai/ghostty which suppresses mouse reports on focus-transfer clicks. This fixes phantom text selection when clicking between panes. Upstream PR: ghostty-org/ghostty#11167 Upstream fix: ghostty-org/ghostty#11276
jpnurmi
added a commit
to jpnurmi/limux
that referenced
this pull request
Jul 16, 2026
Cherry-picks upstream commit 0fa12f8 from manaflow-ai/ghostty which suppresses mouse reports on focus-transfer clicks. This fixes phantom text selection when clicking between panes. Upstream PR: ghostty-org/ghostty#11167 Upstream fix: ghostty-org/ghostty#11276
jpnurmi
added a commit
to jpnurmi/limux
that referenced
this pull request
Jul 16, 2026
Cherry-picks upstream commit 0fa12f8 from manaflow-ai/ghostty which suppresses mouse reports on focus-transfer clicks. This fixes phantom text selection when clicking between panes. Upstream PR: ghostty-org/ghostty#11167 Upstream fix: ghostty-org/ghostty#11276
christmic
pushed a commit
to christmic/Sylvander
that referenced
this pull request
Aug 12, 2026
… (#11665) Also added a test case for ghostty-org/ghostty#11276, which will fail right before that commit. ## AI Disclosure Claude helped me to write some dummy texts for testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11203
The
suppressNextLeftMouseUpflag from #11167 wasn't being reset on focus loss, causing stale state that led to phantom drags/selections and scrolls if you're lucky enough.I've followed the #11167 's path and made it reset on focus loss.
As I stated in the vouch request; I'm not experienced in Swift, just following the prior PR's steps to reset the state. I've been using this patch for couple days and the change looks trivial to me tho not 100% sure if I'm missing anything.
Note
Used Claude Code -Opus 4.6- for navigating the codebase and reviewing the change.