diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-05 09:58:55 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-08-05 09:58:55 (GMT) |
commit | 2144aece152bc34faff5b25632e808e96d523f48 (patch) | |
tree | 7a3762788646792cd131f13ce4115111d16790fe /src/gui/widgets | |
parent | babf1ff43584b454ac24728fbf93bf291b9f36d1 (diff) | |
parent | 1be2e830da7aa09f92d8cdca906f8a588cd10381 (diff) | |
download | Qt-2144aece152bc34faff5b25632e808e96d523f48.zip Qt-2144aece152bc34faff5b25632e808e96d523f48.tar.gz Qt-2144aece152bc34faff5b25632e808e96d523f48.tar.bz2 |
Merge remote branch 'lighthouse/4.7' into lighthouse-master
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmainwindowlayout_mac.mm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index b8cef93..1bfc746 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -48,6 +48,7 @@ #include <Carbon/Carbon.h> #else #include <private/qcocoatoolbardelegate_mac_p.h> +#import <private/qcocoawindowdelegate_mac_p.h> #endif QT_BEGIN_NAMESPACE @@ -337,6 +338,17 @@ void QMainWindowLayout::updateHIToolBarStatus() #endif layoutState.mainWindow->setUpdatesEnabled(false); // reduces a little bit of flicker, not all though +#if defined(QT_MAC_USE_COCOA) + QMacCocoaAutoReleasePool pool; + NSView *cView = [qt_mac_window_for(layoutState.mainWindow) contentView]; + if (useMacToolbar) { + [cView setPostsFrameChangedNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] + selector: @selector(syncContentViewFrame:) + name: NSViewFrameDidChangeNotification + object: cView]; + } +#endif if (!useMacToolbar) { macWindowToolbarShow(layoutState.mainWindow, false); // Move everything out of the HIToolbar into the main toolbar. @@ -356,6 +368,14 @@ void QMainWindowLayout::updateHIToolBarStatus() } syncUnifiedToolbarVisibility(); } +#if defined(QT_MAC_USE_COCOA) + if (!useMacToolbar) { + [cView setPostsFrameChangedNotifications:NO]; + [[NSNotificationCenter defaultCenter] removeObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] + name: NSViewFrameDidChangeNotification + object: cView]; + } +#endif layoutState.mainWindow->setUpdatesEnabled(true); } |