-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the bug
A double_clicked() event is incorrectly triggered on a widget if the first click of the double click sequence occurred on a different UI element. It appears the logic for detecting double-clicks is tracking the time interval between any two clicks globally, rather than ensuring both clicks were targeted at the same widget.
To Reproduce
Steps to reproduce the behavior:
- Click once anywhere in the application
- Quickly click a button or widget that has response.double_clicked() logic.
- Observe that double_clicked() returns true, even though the widget was only clicked once.
Expected behavior
double_clicked() should only return true if both clicks in the rapid sequence occur within the bounding box of the same widget. If the first click was elsewhere, the subsequent click should only register as a single clicked().
Desktop (please complete the following information):
- OS: Windows 11, native app
Video evidence
https://github.com/emilk/egui/assets/109111928/11d128c7-5d41-4805-a449-8118fb7d8c76