diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcocoawindowdelegate_mac.mm | 7 | ||||
-rw-r--r-- | src/gui/kernel/qcocoawindowdelegate_mac_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index 355f9bf..f81e788 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -51,6 +51,7 @@ #include <QMainWindow> #include <QToolBar> #include <private/qmainwindowlayout_p.h> +#include <private/qpaintengine_mac_p.h> QT_BEGIN_NAMESPACE extern QWidgetData *qt_qwidget_data(QWidget *); // qwidget.cpp @@ -392,6 +393,12 @@ static void cleanupCocoaWindowDelegate() m_drawerHash->remove(drawer); } +- (void)windowDidChangeScreen:(NSNotification*)notification +{ + QWidget *qwidget = m_windowHash->value([notification object]); + QCoreGraphicsPaintEngine::clearColorSpace(qwidget); +} + - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu { Q_UNUSED(menu); diff --git a/src/gui/kernel/qcocoawindowdelegate_mac_p.h b/src/gui/kernel/qcocoawindowdelegate_mac_p.h index 2598b77..c1fa2be 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac_p.h +++ b/src/gui/kernel/qcocoawindowdelegate_mac_p.h @@ -76,6 +76,7 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData) - (void)windowDidResignMain:(NSNotification*)notification; - (void)windowDidBecomeKey:(NSNotification*)notification; - (void)windowDidResignKey:(NSNotification*)notification; +- (void)windowDidChangeScreen:(NSNotification*)notification; - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu; - (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard; - (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index efd2ff2..e99dabf 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2803,6 +2803,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (window) qt_mac_destructWindow(window); } +#ifdef QT_MAC_USE_COCOA + if (isWindow()) + QCoreGraphicsPaintEngine::clearColorSpace(this); +#endif } QT_TRY { d->setWinId(0); |