From 0be1c4899c15221bf265713e714f5301bfa909d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 11 Apr 2014 15:11:09 +0200 Subject: Cocoa: Don't consume events when closing tool tips With change acebf677 we treat Qt::ToolTip similar to Qt::Popup and close them on a mouse click on the parent window. This mouse click is not forwarded to the standard mouse event handler. Add an exception for Qt::ToolTip. Task-number: QTBUG-38267 Change-Id: Ie3121f651a6ccc2427040e61db4f63967467604d Reviewed-by: Eike Ziller Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qnsview.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 0b9683a3ef..93462e7ea1 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -639,8 +639,12 @@ static QTouchDevice *touchDevice = 0; if (m_platformWindow->m_activePopupWindow) { QWindowSystemInterface::handleCloseEvent(m_platformWindow->m_activePopupWindow); QWindowSystemInterface::flushWindowSystemEvents(); + Qt::WindowType type = m_platformWindow->m_activePopupWindow->type(); m_platformWindow->m_activePopupWindow = 0; - return; + // Consume the mouse event when closing the popup, except for tool tips + // were it's expected that the event is processed normally. + if (type != Qt::ToolTip) + return; } if ([self hasMarkedText]) { NSInputManager* inputManager = [NSInputManager currentInputManager]; -- cgit v1.2.3