Skip to content

Fix lost mouse release events in case the pane becomes inactive#3271

Merged
JoeKar merged 2 commits intomicro-editor:masterfrom
JoeKar:fix/inactive-mouse-release
Apr 27, 2024
Merged

Fix lost mouse release events in case the pane becomes inactive#3271
JoeKar merged 2 commits intomicro-editor:masterfrom
JoeKar:fix/inactive-mouse-release

Conversation

@JoeKar
Copy link
Member

@JoeKar JoeKar commented Apr 25, 2024

A first shot to fix the mouse releases received in a different pane/tab, while the one pressed still waits for his release.

Fixes #3251

@JoeKar JoeKar requested a review from dmaluka April 25, 2024 21:28
@JoeKar JoeKar force-pushed the fix/inactive-mouse-release branch from 095aee2 to 1313d39 Compare April 27, 2024 17:58
case tcell.ButtonNone:
if t.List[t.Active()].release {
// Mouse release received, while already released...reset mouse
t.ResetMouse()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we can return here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, we can. the ButtonNone event in the Tab's HandleEvent does what it needs to do in case the release was for the active Tab.
So I will add the return.

@JoeKar JoeKar force-pushed the fix/inactive-mouse-release branch from 1313d39 to 0a1447b Compare April 27, 2024 19:38
@JoeKar JoeKar merged commit 1f51d0b into micro-editor:master Apr 27, 2024
@JoeKar JoeKar deleted the fix/inactive-mouse-release branch April 27, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mouse release event is lost if the pane becomes inactive

2 participants