Skip to content

Double click issue #3508

@bl4ze4447

Description

@bl4ze4447

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:

  1. Click once anywhere in the application
  2. Quickly click a button or widget that has response.double_clicked() logic.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions