macOS: convert mask region to native geometry
QWindow::mask() returns a region in device independent geometry which can’t be used directly by the platform plugin. Pick-to: 6.2 5.15 Task-number: QTBUG-94770 Change-Id: I76279bc74cfabe315178327938f485f4447568be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
b020ec6ada
commit
83419fb8a3
@ -63,6 +63,7 @@
|
|||||||
#include <private/qcoregraphics_p.h>
|
#include <private/qcoregraphics_p.h>
|
||||||
#include <private/qwindow_p.h>
|
#include <private/qwindow_p.h>
|
||||||
#include <private/qpointingdevice_p.h>
|
#include <private/qpointingdevice_p.h>
|
||||||
|
#include <private/qhighdpiscaling_p.h>
|
||||||
#include "qcocoabackingstore.h"
|
#include "qcocoabackingstore.h"
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
#include "qcocoaglcontext.h"
|
#include "qcocoaglcontext.h"
|
||||||
|
@ -341,7 +341,7 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID)
|
|||||||
Q_UNUSED(qtScreenPoint);
|
Q_UNUSED(qtScreenPoint);
|
||||||
|
|
||||||
// Maintain masked state for the button for use by MouseDragged and MouseUp.
|
// Maintain masked state for the button for use by MouseDragged and MouseUp.
|
||||||
QRegion mask = m_platformWindow->window()->mask();
|
QRegion mask = QHighDpi::toNativeLocalPosition(m_platformWindow->window()->mask(), m_platformWindow->window());
|
||||||
const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
|
const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
|
||||||
if (masked)
|
if (masked)
|
||||||
m_acceptedMouseDowns &= ~button;
|
m_acceptedMouseDowns &= ~button;
|
||||||
@ -410,7 +410,7 @@ static const QPointingDevice *pointingDeviceFor(qint64 deviceID)
|
|||||||
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
|
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint];
|
||||||
Q_UNUSED(qtScreenPoint);
|
Q_UNUSED(qtScreenPoint);
|
||||||
|
|
||||||
QRegion mask = m_platformWindow->window()->mask();
|
QRegion mask = QHighDpi::toNativeLocalPosition(m_platformWindow->window()->mask(), m_platformWindow->window());
|
||||||
const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
|
const bool masked = !mask.isEmpty() && !mask.contains(qtWindowPoint.toPoint());
|
||||||
// Maintain masked state for the button for use by MouseDragged and Up.
|
// Maintain masked state for the button for use by MouseDragged and Up.
|
||||||
if (masked)
|
if (masked)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user