From 3e4c9cb3d6177c8feb4d57f900f118596f7b3c18 Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Tue, 13 Aug 2013 15:58:41 -0700 Subject: [PATCH] Cocoa: Set window title after setting window flags if window has border A QWindow should keep its title after removing and restoring the frame, so set it if we are setting window flags that include a frame. Task-number: QTBUG-32978 Change-Id: I0fe1b651eac05a210b06ec4f7f6fb78f2536834d Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 1126315126..26869d4b5f 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -486,6 +486,9 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) [m_nsWindow setStyleMask:styleMask]; [m_nsWindow setLevel:level]; setWindowShadow(flags); + if (!(styleMask & NSBorderlessWindowMask)) { + setWindowTitle(window()->title()); + } } m_windowFlags = flags;