summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview_mouse.mm
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-02-22 08:19:01 +0100
committerAndy Shaw <andy.shaw@qt.io>2019-04-01 12:22:54 +0000
commita49c5648919a0bd2d8206ae7fb5033c9f84e0a86 (patch)
tree25b7c3d198b7752cbac3e33fdfe4ae8fbb5e046e /src/plugins/platforms/cocoa/qnsview_mouse.mm
parente104c1972877c1732aa3c58f52bb766a0bfa29e7 (diff)
Implement support for WA_MacNoClickThrough
This is done by adding a QWindowPrivate::allowsClickThrough() function, so this could easily be adapted later on if desired for other platforms. Fixes: QTBUG-41126 Change-Id: I1157e5e7e7667ff11d1a5d21b3ce8c4b13202272 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_mouse.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index 6e3cff2b48..0ab09b97d3 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -197,6 +197,11 @@
return NO;
if ([self isTransparentForUserInput])
return NO;
+ QPointF windowPoint;
+ QPointF screenPoint;
+ [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint: &windowPoint andScreenPoint: &screenPoint];
+ if (!qt_window_private(m_platformWindow->window())->allowClickThrough(screenPoint.toPoint()))
+ return NO;
return YES;
}