Merge pull request #31 from SBG-Systems/fix_dual_screen

Fix object detection with dual screen
This commit is contained in:
Yuhang Zhao 2020-11-03 14:25:03 +08:00 committed by GitHub
commit d06a5ccab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -1881,14 +1881,17 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
dpr)
: true;
#if defined(QT_WIDGETS_LIB) || defined(QT_QUICK_LIB)
const bool isInIgnoreObjects = isInSpecificObjects(globalMouse.x,
globalMouse.y,
// For this purpose, QCursor give more accurate position
// than windows when using several monitors.
const auto qtGlobalMousePos = QCursor::pos() * dpr;
const bool isInIgnoreObjects = isInSpecificObjects(qtGlobalMousePos.x(),
qtGlobalMousePos.y(),
data->ignoreObjects,
dpr);
const bool customDragObjects = !data->draggableObjects.isEmpty();
const bool isInDraggableObjects = customDragObjects
? isInSpecificObjects(globalMouse.x,
globalMouse.y,
? isInSpecificObjects(qtGlobalMousePos.x(),
qtGlobalMousePos.y(),
data->draggableObjects,
dpr)
: true;