summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 68cbb00..f38adb1 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -320,6 +320,10 @@ static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr,
static void RemapWindows(TkWindow *winPtr,
MacDrawable *parentWin);
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+#define TK_GOT_AT_LEAST_SNOW_LEOPARD 1
+#endif
+
#pragma mark TKWindow(TKWm)
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
@@ -5504,7 +5508,11 @@ TkMacOSXMakeRealWindowExist(
}
if (opaqueTag != NULL) {
+#ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD
[window setOpaque: opaqueTag];
+#else
+ [window setOpaque: YES];
+#endif
}
[window setDocumentEdited:NO];
@@ -6348,7 +6356,9 @@ TkMacOSXMakeFullscreen(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN);
+#ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD
static unsigned long prevMask = 0, prevPres = 0;
+#endif /*TK_GOT_AT_LEAST_SNOW_LEOPARD*/
if (fullscreen) {
int screenWidth = WidthOfScreen(Tk_Screen(winPtr));
@@ -6388,17 +6398,27 @@ TkMacOSXMakeFullscreen(
wmPtr->flags |= WM_FULLSCREEN;
}
+#ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD
+ /*
+ * We can't set these features on Leopard or earlier, as they don't
+ * exist (neither options nor API that uses them). This formally means
+ * that there's a bug with full-screen windows with Tk on old OSX, but
+ * it isn't worth blocking a build just for this.
+ */
+
prevMask = [window styleMask];
prevPres = [NSApp presentationOptions];
[window setStyleMask: NSBorderlessWindowMask];
[NSApp setPresentationOptions: NSApplicationPresentationAutoHideDock
| NSApplicationPresentationAutoHideMenuBar];
-
+#endif /*TK_GOT_AT_LEAST_SNOW_LEOPARD*/
} else {
wmPtr->flags &= ~WM_FULLSCREEN;
+#ifdef TK_GOT_AT_LEAST_SNOW_LEOPARD
[NSApp setPresentationOptions: prevPres];
[window setStyleMask: prevMask];
+#endif /*TK_GOT_AT_LEAST_SNOW_LEOPARD*/
}
if (wasFullscreen && !(wmPtr->flags & WM_FULLSCREEN)) {