summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_mac.mm
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-08 14:35:41 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-08 14:35:41 (GMT)
commit91323ecc5b884679e04b29072508fec6e765a666 (patch)
treef21d6803c2e6bf25c983ea4e21ff009e6d60ca05 /src/gui/kernel/qapplication_mac.mm
parent14e4314b5c2cfddb1e92fa1fefeaf7bea2dd6b3a (diff)
parent4336436b8113d6a80428d70beda40a89713d04db (diff)
downloadQt-91323ecc5b884679e04b29072508fec6e765a666.zip
Qt-91323ecc5b884679e04b29072508fec6e765a666.tar.gz
Qt-91323ecc5b884679e04b29072508fec6e765a666.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/kernel/qapplication_mac.mm')
-rw-r--r--src/gui/kernel/qapplication_mac.mm28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index 82fbd7b..a28d2e8 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -154,6 +154,10 @@
#define kThemeBrushAlternatePrimaryHighlightColor -5
#endif
+#define kCMDeviceUnregisteredNotification CFSTR("CMDeviceUnregisteredNotification")
+#define kCMDefaultDeviceNotification CFSTR("CMDefaultDeviceNotification")
+#define kCMDeviceProfilesNotification CFSTR("CMDeviceProfilesNotification")
+#define kCMDefaultDeviceProfileNotification CFSTR("CMDefaultDeviceProfileNotification")
QT_BEGIN_NAMESPACE
@@ -1040,11 +1044,29 @@ void qt_release_app_proc_handler()
#endif
}
+void qt_color_profile_changed(CFNotificationCenterRef, void *, CFStringRef, const void *,
+ CFDictionaryRef)
+{
+ QCoreGraphicsPaintEngine::cleanUpMacColorSpaces();
+}
/* platform specific implementations */
void qt_init(QApplicationPrivate *priv, int)
{
if (qt_is_gui_used) {
CGDisplayRegisterReconfigurationCallback(qt_mac_display_change_callbk, 0);
+ CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter();
+ CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed,
+ kCMDeviceUnregisteredNotification, 0,
+ CFNotificationSuspensionBehaviorDeliverImmediately);
+ CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed,
+ kCMDefaultDeviceNotification, 0,
+ CFNotificationSuspensionBehaviorDeliverImmediately);
+ CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed,
+ kCMDeviceProfilesNotification, 0,
+ CFNotificationSuspensionBehaviorDeliverImmediately);
+ CFNotificationCenterAddObserver(center, qApp, qt_color_profile_changed,
+ kCMDefaultDeviceProfileNotification, 0,
+ CFNotificationSuspensionBehaviorDeliverImmediately);
ProcessSerialNumber psn;
if (GetCurrentProcess(&psn) == noErr) {
// Jambi needs to transform itself since most people aren't "used"
@@ -1224,6 +1246,12 @@ void qt_release_apple_event_handler()
void qt_cleanup()
{
CGDisplayRemoveReconfigurationCallback(qt_mac_display_change_callbk, 0);
+ CFNotificationCenterRef center = CFNotificationCenterGetDistributedCenter();
+ CFNotificationCenterRemoveObserver(center, qApp, kCMDeviceUnregisteredNotification, 0);
+ CFNotificationCenterRemoveObserver(center, qApp, kCMDefaultDeviceNotification, 0);
+ CFNotificationCenterRemoveObserver(center, qApp, kCMDeviceProfilesNotification, 0);
+ CFNotificationCenterRemoveObserver(center, qApp, kCMDefaultDeviceProfileNotification, 0);
+
#ifndef QT_MAC_USE_COCOA
qt_release_app_proc_handler();
if (app_proc_handlerUPP) {