1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Fix: still track mouse when dragging outside web canvas (#4522)

* Closes https://github.com/emilk/egui/issues/3157

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

---

To support this, I had to revert https://github.com/emilk/egui/pull/4419
Despite that, I fail to reproduce the two issues it claimed to solve:

* https://github.com/emilk/egui/issues/4406 may have been solved in
another way by this PR
* https://github.com/emilk/egui/issues/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`
This commit is contained in:
Emil Ernerfeldt
2024-05-22 11:48:34 +02:00
committed by GitHub
parent 7035aa4e53
commit c8578c9a6b
5 changed files with 73 additions and 56 deletions

View File

@@ -466,23 +466,23 @@ fn response_summary(response: &egui::Response, show_hovers: bool) -> String {
// These are in inverse logical/chonological order, because we show them in the ui that way:
if response.triple_clicked_by(button) {
writeln!(new_info, "Triple_clicked_by{button_suffix}").ok();
writeln!(new_info, "Triple-clicked{button_suffix}").ok();
}
if response.double_clicked_by(button) {
writeln!(new_info, "Double_clicked_by{button_suffix}").ok();
writeln!(new_info, "Double-clicked{button_suffix}").ok();
}
if response.clicked_by(button) {
writeln!(new_info, "Clicked_by{button_suffix}").ok();
writeln!(new_info, "Clicked{button_suffix}").ok();
}
if response.drag_stopped_by(button) {
writeln!(new_info, "Drag_stopped_by{button_suffix}").ok();
writeln!(new_info, "Drag stopped{button_suffix}").ok();
}
if response.dragged_by(button) {
writeln!(new_info, "Dragged_by{button_suffix}").ok();
writeln!(new_info, "Dragged{button_suffix}").ok();
}
if response.drag_started_by(button) {
writeln!(new_info, "Drag_started_by{button_suffix}").ok();
writeln!(new_info, "Drag started{button_suffix}").ok();
}
}