double click event does not open constran value edit dialog in scatch

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
rational-opinion
Posts: 2
Joined: Tue Aug 16, 2022 10:45 am

double click event does not open constran value edit dialog in scatch

Post by rational-opinion »

This looks like a UI bug. I can reproduce it in version 19.3 20 and latest. In 2 different win PCs. The bug is related to mouse click speed setting. For the fastest and second fastest setting it does not work, for slower ones it seems ok. Some other parts of Freecad handle double click correctly. It is possible that some code is trying to measure the delay and doing it badly instead of relaying on system events. Unfortunately mouse setting is not app specific so I can not have specific setting just for Freecad as workaroud. For now I do triple click which acts as double click should, but it is not convenient and makes me wonder which other pars of UI are broken like this.
I fond an old post with similar issue in Linux, but they never realized it was dependent on the mouse setting and it was not solved.
It is easy to reproduce. Change click speed and try edit the size by double click.
Image
Attachments
New0001.png
New0001.png (4.83 KiB) Viewed 602 times
New0000.png
New0000.png (21.02 KiB) Viewed 602 times
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: double click event does not open constran value edit dialog in scatch

Post by chrisb »

Hi and welcome to the forum!

Please describe what happens and what you expect.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: double click event does not open constran value edit dialog in scatch

Post by GeneFC »

rational-opinion wrote: Tue Aug 16, 2022 11:28 am
Following the requests in the red box at the top of the page is critical for this topic. Open FreeCAD and select Help >> About. Copy to your clipboard and paste here.

The behavior of double-click is completely controlled by Qt, a key library for FreeCAD. The behavior is different for Windows, Mac, and Linux.

Qt should follow the OS choice for click speed in Windows and Mac, but the interval is fixed for Linux.

Gene
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: double click event does not open constran value edit dialog in scatch

Post by openBrain »

GeneFC wrote: Tue Aug 16, 2022 4:50 pm The behavior of double-click is completely controlled by Qt, a key library for FreeCAD. The behavior is different for Windows, Mac, and Linux.
I'm sorry I have to tell it's wrong, only in this specific case : https://github.com/FreeCAD/FreeCAD/blob ... h.cpp#L684

Double-click time is, in this case, measured internally by FreeCAD.
However, the code is correct and the problem isn't due to some basic error in the implementation.

The maximum double-click speed (minimum time) setting in Windows corresponds to 200 ms. This is rather short. While a human (in good conditions) should be able to double-click around 100~125 ms, then if you consider things that may happen to events in the OS+mouse driver, then in the runtime env (Qt) then in the applicative libs (Coin, Quarter) then finally in the application, at the end it could be a hardly reachable value.

I probed the code and, with a rather good computer, I can reach a time at application level of around 175~195 ms, but it's not rare that the value can be in the 201~225 ms range. Hence with a setting @200 ms, it won't trigger a double-click.
I guess that with a computer lacking power or being loaded, it could become the case every time.

I also observed that when doing a triple-click, the time (at application level) seems shorter between click 2 & 3 than between 1 & 2. I have no clue where it may come from (BKAC, OS/driver, runtime env ???) but it may explain why OP can get the "double-click" behavior by doing a triple-click, because timing between clicks 2 & 3 matches the expected value.

I don't know what could be a solution, and I'm actually not sure ATM that something needs to be done. Sometime we have to bet on the user to use reasonable settings. :)
Post Reply