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)
: 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;