Skip to content
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

Treat Event::PointerGone as PointerEvent::Released #4419

Merged
merged 18 commits into from May 11, 2024

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Apr 26, 2024

@rustbasic rustbasic changed the title Fix: drag_stopped_by() not detected after mouse release. Fix: In some cases, drag_stopped_by() not detected after mouse release. Apr 26, 2024
@rustbasic rustbasic closed this Apr 27, 2024
@rustbasic rustbasic reopened this Apr 27, 2024
@rustbasic rustbasic closed this Apr 27, 2024
@rustbasic rustbasic reopened this Apr 28, 2024
@rustbasic rustbasic changed the title Fix: In some cases, drag_stopped_by() not detected after mouse release. Saves the state of each PointerButton. Apr 28, 2024
@rustbasic rustbasic closed this Apr 28, 2024
@rustbasic rustbasic changed the title Saves the state of each PointerButton. Fix: In some cases, drag_stopped_by() not detected after mouse release. Apr 28, 2024
@rustbasic rustbasic reopened this Apr 28, 2024
@rustbasic rustbasic closed this Apr 28, 2024
@rustbasic rustbasic reopened this Apr 28, 2024
@rustbasic rustbasic changed the title Fix: In some cases, drag_stopped_by() not detected after mouse release. If Event::PointerGone occurs, it is treated as PointerEvent::Released. Apr 28, 2024
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Makes sense, but please revert unrelated changea

Comment on lines 459 to 464
let button_suffix = if button == egui::PointerButton::Primary {
// Reduce visual clutter in common case:
String::default()
} else {
format!(" by {button:?} button")
};
Copy link
Owner

Choose a reason for hiding this comment

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

please revert

@rustbasic rustbasic requested a review from emilk May 11, 2024 01:54
@emilk emilk added the egui label May 11, 2024
@emilk emilk changed the title If Event::PointerGone occurs, it is treated as PointerEvent::Released. Treat Event::PointerGone as PointerEvent::Released May 11, 2024
@emilk emilk merged commit 66d2b3f into emilk:master May 11, 2024
19 of 20 checks passed
emilk added a commit that referenced this pull request May 21, 2024
emilk added a commit that referenced this pull request May 22, 2024
* Closes #3157

If the mouse leaves the canvas when dragging a slider, the slider will
still move.

---

To support this, I had to revert #4419
Despite that, I fail to reproduce the two issues it claimed to solve:

* #4406 may have been solved in
another way by this PR
* #4418 I cannot reproduce on Mac.
If it is still a problem, I think it should be solved by triggering a
`PointerEvent::Released` when focus is lost (i.e. on alt-tab), and not
on `PointerGone`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants