summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-09-17 17:13:36 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-09-18 17:30:37 +0200
commite7db28fa9ddb6cf165cf239836f3ee50913cd3d3 (patch)
treec2afd6c7033363e5dd57ca27d339dae0b2d0cc10 /src/plugins
parent0d3b395c164039cae0c72ab27294c86f0adbbc89 (diff)
macOS: Remove remnant of popup closing logic from Cocoa plugin
This monitor call back is never called when a popup is open and there's mouse action. Change-Id: I6c45b600ebea16e5fd6c5b3af66fd1242973d747 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm28
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())