Tk Source Code

Attachment Details
Login
Overview

Artifact ID: 50dd5bafffa04526b665c83d7e7046ad585bfe601d11967dbe3736733ac7c55d (Awaiting Moderator Approval)
Ticket: c789692418553e02c2c6de57f3b0ef9b793380b8
Date: 2025-07-26 15:17:54
User: sevanj
Artifact Attached: eaf0ef3bf69a84d4e0f8f16a2075dc17646228623275b3b191253a8fd9e02584
Filename:patch-tk86-gcc42-macosx-fix.txt
Description:Splitting out the turnary operation into an if else block is sufficient to make Tk 8.6.16 compile on OS X 10.6 with GCC 4.2 again.
Content Appended
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
--- macosx/tkMacOSXWindowEvent.c.orig	2025-07-26 14:20:28.000000000 +0100
+++ macosx/tkMacOSXWindowEvent.c	2025-07-26 14:24:11.000000000 +0100
@@ -977,8 +977,11 @@
 	self.layer = [CALayer layer];
 	self.wantsLayer = YES;
 	self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay;
-	self.layer.contentsGravity = self.layer.contentsAreFlipped ?
-	    kCAGravityTopLeft : kCAGravityBottomLeft;
+	if (self.layer.contentsAreFlipped) {
+	    self.layer.contentsGravity = kCAGravityTopLeft;
+	} else {
+	    self.layer.contentsGravity = kCAGravityBottomLeft;
+	}
 
 	/*
 	 * Nothing gets drawn at all if the layer does not have a delegate.