From acebf6771236a31889c1e888f3ffc5aee1ab9124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 25 Mar 2014 14:56:09 +0100 Subject: Cocoa: Close ToolTips on parent window move. Treat Qt::ToolTip windows the same way as Qt::Popup windows: The parent window keeps track visible transient child windows of this type and closes them when appropriate. This improves the locator popup window behavior in Qt Creator: It now closes when moving the main Qt Creator window. Change-Id: Ibc5d0713469b7c9aba2fd13fb1eb559706c8c4ed Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index b27e1b03db..df15b008ab 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -619,11 +619,13 @@ void QCocoaWindow::setVisible(bool visible) // update the window geometry if there is a parent. setGeometry(window()->geometry()); - // Register popup windows so that the parent window can - // close them when needed. - if (window()->type() == Qt::Popup) { + // Register popup windows so that the parent window can close them when needed. + if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip) { // qDebug() << "transientParent and popup" << window()->type() << Qt::Popup << (window()->type() & Qt::Popup); parentCocoaWindow->m_activePopupWindow = window(); + } + + if (window()->type() == Qt::Popup) { // QTBUG-30266: a window should not be resizable while a transient popup is open // Since this isn't a native popup, the window manager doesn't close the popup when you click outside NSUInteger parentStyleMask = [parentCocoaWindow->m_nsWindow styleMask]; -- cgit v1.2.3