From 60ddddfc7cd740b62a5afc49c45402d58d733feb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 6 Jan 2023 16:07:11 +0000 Subject: Fix [d84d334ae6]: Fix build on older macOS System --- macosx/tkMacOSXWindowEvent.c | 6 +++++- macosx/tkMacOSXWm.c | 32 ++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index a806729..ef8e958 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -309,7 +309,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification; observe(NSWindowWillStartLiveResizeNotification, windowLiveResize:); observe(NSWindowDidEndLiveResizeNotification, windowLiveResize:); -#if !(MAC_OS_X_VERSION_MAX_ALLOWED < 1070) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 observe(NSWindowDidEnterFullScreenNotification, windowEnteredFullScreen:); observe(NSWindowDidExitFullScreenNotification, windowExitedFullScreen:); #endif @@ -1009,6 +1009,7 @@ ConfigureRestrictProc( return NO; } +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - (void) viewDidChangeBackingProperties { @@ -1021,6 +1022,7 @@ ConfigureRestrictProc( self.layer.contentsScale = self.window.screen.backingScaleFactor; } +#endif - (void) addTkDirtyRect: (NSRect) rect { @@ -1277,6 +1279,8 @@ static const char *const accentNames[] = { change:(NSDictionary *)change context:(void *)context { + (void) change; + (void) context; NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults]; if (object == preferences && [keyPath isEqualToString:@"AppleHighlightColor"]) { if (@available(macOS 10.14, *)) { diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index b72c5a7..3fd8af7 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -406,7 +406,7 @@ static void RemoveTransient(TkWindow *winPtr); } } -#if !(MAC_OS_X_VERSION_MAX_ALLOWED < 101200) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 - (void)toggleTabBar:(id)sender { TkWindow *winPtr = TkMacOSXGetTkWindow(self); @@ -1418,7 +1418,7 @@ WmSetAttribute( return TCL_ERROR; } if (boolean != (([macWindow styleMask] & NSFullScreenWindowMask) != 0)) { -#if !(MAC_OS_X_VERSION_MAX_ALLOWED < 1070) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 [macWindow toggleFullScreen:macWindow]; #else TKLog(@"The fullscreen attribute is ignored on this system."); @@ -1717,7 +1717,8 @@ WmColormapwindowsCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow **cmapList, *winPtr2; - int i, windowObjc, gotToplevel = 0; + int i, windowObjc; + int gotToplevel = 0; Tcl_Obj **windowObjv, *resultObj; if ((objc != 3) && (objc != 4)) { @@ -5792,7 +5793,8 @@ WmWinStyle( { NULL, 0 } }; - int index, i; + int index; + int i; WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc == 3) { @@ -5916,7 +5918,13 @@ WmWinTabbingId( int objc, /* Number of arguments. */ Tcl_Obj * const objv[]) /* Argument objects. */ { -#if !(MAC_OS_X_VERSION_MAX_ALLOWED < 101200) +#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200 + (void) interp; + (void) winPtr; + (void) objc; + (void) objv; + return TCL_OK; +#else Tcl_Obj *result = NULL; NSString *idString; NSWindow *win = TkMacOSXGetNSWindowForDrawable(winPtr->window); @@ -5953,8 +5961,8 @@ WmWinTabbingId( } return TCL_OK; } -#endif return TCL_ERROR; +#endif } /* @@ -5995,7 +6003,13 @@ WmWinAppearance( int objc, /* Number of arguments. */ Tcl_Obj * const objv[]) /* Argument objects. */ { -#if MAC_OS_X_VERSION_MAX_ALLOWED > 1090 +#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1090 + (void) interp; + (void) winPtr; + (void) objc; + (void) objv; + return TCL_OK; +#else static const char *const appearanceStrings[] = { "aqua", "darkaqua", "auto", NULL }; @@ -6055,8 +6069,6 @@ WmWinAppearance( } Tcl_SetObjResult(interp, result); return TCL_OK; -#else // MAC_OS_X_VERSION_MAX_ALLOWED > 1090 - return TCL_ERROR; #endif } @@ -7203,7 +7215,7 @@ GetMaxSize( * of the window. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; - NSRect *maxBounds = (NSRect*)(winPtr->display->screens->ext_data); + NSRect *maxBounds = (NSRect*)(ScreenOfDisplay(winPtr->display, 0)->ext_data); if (wmPtr->maxWidth > 0) { *maxWidthPtr = wmPtr->maxWidth; -- cgit v0.12