summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXColor.c6
-rw-r--r--macosx/tkMacOSXDialog.c2
-rw-r--r--macosx/tkMacOSXDraw.c4
-rw-r--r--macosx/tkMacOSXNotify.c10
-rw-r--r--macosx/tkMacOSXWindowEvent.c4
-rw-r--r--macosx/tkMacOSXWm.c1
6 files changed, 12 insertions, 15 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 3380087..459ca47 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -266,13 +266,9 @@ GetThemeColor(
break;
}
- // this attempts to find something roughly fitting for any display
-// *c = CGColorCreateGenericRGB(rgba[0], rgba[1], rgba[2], rgba[3]);
-
- // may be off for non-main display but in most cases better than prev
static CGColorSpaceRef deviceRGBSpace = NULL;
if (!deviceRGBSpace) {
- deviceRGBSpace = CGDisplayCopyColorSpace(CGMainDisplayID());
+ deviceRGBSpace = CGColorSpaceCreateDeviceRGB();
}
*c = CGColorCreate(deviceRGBSpace, rgba );
}
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 9fc3057..3bcbf1f 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -375,7 +375,7 @@ Tk_ChooseColorObjCmd(
returnCode = [NSApp runModalForWindow:colorPanel];
if (returnCode == modalOK) {
color = [[colorPanel color] colorUsingColorSpace:
- [NSColorSpace genericRGBColorSpace]];
+ [NSColorSpace deviceRGBColorSpace]];
numberOfComponents = [color numberOfComponents];
}
if (color && numberOfComponents >= 3 && numberOfComponents <= 4) {
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 046c51d..80a4910 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -483,7 +483,7 @@ CreateCGImageWithXImage(
* Color image
*/
- CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerComponent = 8;
bitsPerPixel = 32;
@@ -685,7 +685,7 @@ GetCGContextForDrawable(
bitsPerPixel = 8;
bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly;
} else {
- colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerPixel = 32;
bitmapInfo |= kCGImageAlphaPremultipliedFirst;
}
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 7bb0b0d..086ed6a 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -216,8 +216,7 @@ TkMacOSXEventsSetupProc(
int flags)
{
NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode];
- // fprintf(stderr, "SetupProc (%s)", [runloopMode UTF8String]);
- /* runloopMode will be nil if we are in the Tcl event loop. */
+ /* runloopMode will be nil if we are in a Tcl event loop. */
if (flags & TCL_WINDOW_EVENTS && !runloopMode) {
static const Tcl_Time zeroBlockTime = { 0, 0 };
[NSApp _resetAutoreleasePool];
@@ -258,14 +257,15 @@ TkMacOSXEventsCheckProc(
int flags)
{
NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode];
- /* runloopMode will be nil if we are in the Tcl event loop. */
+ /* runloopMode will be nil if we are in a Tcl event loop. */
if (flags & TCL_WINDOW_EVENTS && !runloopMode) {
NSEvent *currentEvent = nil;
NSModalSession modalSession;
/* It is possible for the SetupProc to be called before this function
* returns. This happens, for example, when we process an event which
- * opens a modal windows. To prevent premature release of our
- * application-wide autorelease pool, we must lock it here.
+ * opens a modal window. To prevent premature release of our
+ * application-wide autorelease pool by a nested call to the SetupProc,
+ * we must lock it here.
*/
[NSApp _lockAutoreleasePool];
do {
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index df1b138..137ba31 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -358,8 +358,8 @@ GenerateUpdates(
event.xany.window = Tk_WindowId(winPtr);
event.xany.display = Tk_Display(winPtr);
event.type = Expose;
- event.xexpose.x = damageBounds.origin.x;
- event.xexpose.y = damageBounds.origin.y;
+ event.xexpose.x = damageBounds.origin.x - bounds.origin.x;
+ event.xexpose.y = damageBounds.origin.y - bounds.origin.y;
event.xexpose.width = damageBounds.size.width;
event.xexpose.height = damageBounds.size.height;
event.xexpose.count = 0;
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index d013356..750fca8 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -5629,6 +5629,7 @@ TkMacOSXMakeRealWindowExist(
}
TKContentView *contentView = [[TKContentView alloc]
initWithFrame:NSZeroRect];
+ [window setColorSpace:[NSColorSpace deviceRGBColorSpace]];
[window setContentView:contentView];
[contentView release];
[window setDelegate:NSApp];