coin3d / quarter

Coin GUI binding for Qt
BSD 3-Clause "New" or "Revised" License
36 stars 26 forks source link

The problem of creating a QuarterWidget in a multi-monitor environment. #59

Open shixiong2333 opened 1 year ago

shixiong2333 commented 1 year ago

Hello gentlemen,

I have two monitors with the following parameters.

OS version: Win 11 22H2 (Win 10 has the same problem)

First display: (DELL P2419H) Display resolution: 1920*1080 Zoom factor: 100%

Second monitor: (DELL D2421DS) Display resolution: 2560*1440 Zoom factor: 125%

Both monitors are Dell's, but there are some differences in hardware parameters.

Next, I went to run the official Demo ‘MDIExample’.

image

When I create a new window on the main monitor, there is no problem.

image

However, when I create a new window on the secondary display, there will be a misalignment of the OpenGL display area, which will even affect the use of other controls.

image

I encountered this headache when actually using Quarter, which is reflected in my software as follows, and Windows cannot be adapted。

image

This causes the following concurrency issues: For example, if I create a cube with 100 sides and click on the point (100, 100, 100), it is possible to end up giving me feedback to the point of (100, 100, 80) in a certain perspective.

My preliminary research found that this problem has nothing to do with the location of the main window, but with the location of the mouse. When creating a new QuarterWidget, the mouse is on the main monitor, and the created QuarterWidget has no problem. But when the mouse is on a secondary monitor, the QuarterWidget created will be misaligned. My current solution is to use code to temporarily move the mouse to the main monitor when creating the QuarterWidget, and then move the mouse to the original location when the creation is complete.

Could have solved my problem temporarily, but it felt a bit funny. I would like to ask if there is a better way to solve this problem. What about making Quarter more compatible with multiple monitors?

VolkerEnderlein commented 1 year ago

Thank you for this extensive and thoroughly researched bug report. I'll try to reproduce the issue and see if I can come up with a reasonable fix. By the way, what Qt version are you using?

shixiong2333 commented 1 year ago

Thank you for this extensive and thoroughly researched bug report. I'll try to reproduce the issue and see if I can come up with a reasonable fix. By the way, what Qt version are you using?

Thank you for your attention. My version is Qt 5.15.2 (MSVC 2019 64-bit).

xiaodaxia-2008 commented 4 months ago

It's probably related with the High DPI support of Qt5. Have a try with Qt6.