Search Issue Tracker

Fixed in 2022.2.X

Fixed in 2021.3.X, 2022.1.X

Votes

8

Found in

2020.3

2020.3.8f1

2021.1

Issue ID

1337545

Regression

No

UI Toolkit mouse click and down events are called twice on a single click on Linux

Linux

-

How to reproduce:
1. Open the user attached project (BugReport.zip)
2. Open the SampleScene
3. Enter PlayMode
4. Press once on the red and green rectangles
5. In the Console observe the number of times the "Click!" and "MouseDownEvent!" messages were printed

Expected result: the mouse event messages were printed once for each click
Actual result: the mouse event messages were printed twice for each click

Reproducible with: 2020.3.13f1, 2021.1.13f1
Could not test with: 2019.4.28f1 (UI Toolkit incompatible with given Editor version), 2021.2.0b1 (having UI Toolkit installed throws missing namespace errors)

Notes:
1. Reproducible on Ubuntu 18.04
2. Not reproducible on Windows 7
3. UI Toolkit version used 1.0.0-preview.14. Older package versions could not be tested due to compiler errors

  1. Resolution Note (fix version 2022.2):

    Fixed in 2022.2.0a11

  2. Resolution Note (fix version 2022.1):

    Fixed in 2022.1.1f1

  3. Resolution Note (fix version 2021.3):

    Fixed in 2021.3.3f1

Comments (4)

  1. mNKA

    Feb 13, 2023 07:55

    this still happens on Ubuntu 22.04 with Unity 2022.2.3f1, mouse and touchpad.

  2. niel-archer

    Oct 01, 2021 23:35

    Still seeing this on Manjaro with 2021.2.0b14

  3. morabitom

    Oct 01, 2021 14:37

    Running into this with 5.10.68-1-MANJARO and KDE Plasma 5.22.5. Tried with both mouse and touchpad.

    Not reproducible on Windows 10

  4. whitelion123

    Oct 01, 2021 09:03

    This simple code pop two events. The pointerType is correct the first time and a bit strange the second. The x coordinates is not the same.

    Event e = new Event();
    public void Update()
    {
    while(Event.PopEvent(e))
    {
    if (e.rawType == EventType.MouseUp)
    {
    Debug.Log(e);
    Debug.Log(e.clickCount);
    Debug.Log(e.pointerType);
    }
    }
    }

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.