diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-09-15 10:11:27 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-09-15 17:49:34 +0200 |
commit | 6880b6319c833eef4911be603abd14d3537224f1 (patch) | |
tree | 95a118bf52cc0fef5c83837a0b1c042cef9ef1fb /src/plugins/platforms/cocoa | |
parent | 276943c8b791ba5897dcdb1ecfda780ac33a090b (diff) |
macOS: Use QGuiApplication popup APIs in Cocoa plugin
This removes more dependencies to the Cocoa plugin managing its own
popup stack.
Task-number: QTBUG-96450
Change-Id: Id01577739af525a34728f27b790b9aaac29705f2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindow.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index 82daccc68c..bdd2c07f02 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -374,7 +374,7 @@ OSStatus CGSClearWindowTags(const CGSConnectionID, const CGSWindowID, int *, int // close open popups. Presses within the window's content are handled to do that in the // NSView::mouseDown implementation. if (theEvent.type == NSEventTypeLeftMouseDown && mouseEventInFrameStrut) - [qnsview_cast(m_platformWindow->view()) closePopups:theEvent]; + QGuiApplicationPrivate::instance()->closeAllPopups(); [super sendEvent:theEvent]; @@ -385,11 +385,10 @@ OSStatus CGSClearWindowTags(const CGSConnectionID, const CGSWindowID, int *, int // not Qt). However, an active popup is expected to grab any mouse event within the // application, so we need to handle those explicitly and trust Qt's isWindowBlocked // implementation to eat events that shouldn't be delivered anyway. - if (isMouseEvent(theEvent) && QCocoaIntegration::instance()->activePopupWindow() + if (isMouseEvent(theEvent) && QGuiApplicationPrivate::instance()->popupActive() && QGuiApplicationPrivate::instance()->isWindowBlocked(m_platformWindow->window(), nullptr)) { qCDebug(lcQpaWindow) << "Mouse event over modally blocked window" << m_platformWindow->window() - << "while popup" << QCocoaIntegration::instance()->activePopupWindow() - << "is open - redirecting"; + << "while popup is open - redirecting"; [qnsview_cast(m_platformWindow->view()) handleMouseEvent:theEvent]; } if (m_platformWindow->frameStrutEventsEnabled() && mouseEventInFrameStrut) |