Fix object detection with dual screen

This commit is contained in:
Alexandre Petitjean 2020-10-28 11:55:32 +01:00
parent c302bf331c
commit bf2c085519
1 changed files with 7 additions and 4 deletions

View File

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