diff options
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 28 |
2 files changed, 0 insertions, 30 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 419f07b779..fbfe20fe07 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -233,7 +233,6 @@ public: // for QNSView bool isContentView() const; bool alwaysShowToolWindow() const; - void removeMonitor(); enum HandleFlags { NoHandleFlags = 0, @@ -265,7 +264,6 @@ public: // for QNSView static const int NoAlertRequest; NSInteger m_alertRequest; - NSObject *m_monitor; bool m_drawContentBorderGradient; int m_topContentBorderThickness; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 5ffc36a895..6e9166a05a 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -149,7 +149,6 @@ QCocoaWindow::QCocoaWindow(QWindow *win, WId nativeHandle) , m_registerTouchCount(0) , m_resizableTransientParent(false) , m_alertRequest(NoAlertRequest) - , m_monitor(nil) , m_drawContentBorderGradient(false) , m_topContentBorderThickness(0) , m_bottomContentBorderThickness(0) @@ -197,8 +196,6 @@ QCocoaWindow::~QCocoaWindow() if ([m_view superview]) [m_view removeFromSuperview]; - removeMonitor(); - // Make sure to disconnect observer in all case if view is valid // to avoid notifications received when deleting when using Qt::AA_NativeWindows attribute if (!isForeignWindow()) @@ -382,21 +379,6 @@ void QCocoaWindow::setVisible(bool visible) } else { [m_view.window orderFront:nil]; } - - // Close popup when clicking outside it - if (window()->type() == Qt::Popup && !(parentCocoaWindow && window()->transientParent()->isActive())) { - removeMonitor(); - NSEventMask eventMask = NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown - | NSEventMaskOtherMouseDown | NSEventMaskMouseMoved; - m_monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:eventMask handler:^(NSEvent *e) { - const auto button = cocoaButton2QtButton(e); - const auto buttons = currentlyPressedMouseButtons(); - const auto eventType = cocoaEvent2QtMouseEvent(e); - const auto globalPoint = QCocoaScreen::mapFromNative(NSEvent.mouseLocation); - const auto localPoint = window()->mapFromGlobal(globalPoint.toPoint()); - QWindowSystemInterface::handleMouseEvent(window(), localPoint, globalPoint, buttons, button, eventType); - }]; - } } } @@ -438,8 +420,6 @@ void QCocoaWindow::setVisible(bool visible) [m_view setHidden:YES]; } - removeMonitor(); - if (parentCocoaWindow && window()->type() == Qt::Popup) { NSWindow *nativeParentWindow = parentCocoaWindow->nativeWindow(); if (m_resizableTransientParent @@ -1659,14 +1639,6 @@ bool QCocoaWindow::alwaysShowToolWindow() const return qt_mac_resolveOption(false, window(), "_q_macAlwaysShowToolWindow", ""); } -void QCocoaWindow::removeMonitor() -{ - if (!m_monitor) - return; - [NSEvent removeMonitor:m_monitor]; - m_monitor = nil; -} - bool QCocoaWindow::setWindowModified(bool modified) { if (!isContentView()) |