summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-12-17 14:00:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-12-17 14:00:02 (GMT)
commit7570fbe3b848f0d05b9b16849ec6d24ca5ef899f (patch)
treede890c8860a842440f19167c486a6c41a10f7daa
parenta2a620f5b9ecd5fe4c0511a18fd71be23dc9d2ab (diff)
parentc75a225d6fa0e8681ac24e2657b857cf56f4fbbd (diff)
downloadtk-7570fbe3b848f0d05b9b16849ec6d24ca5ef899f.zip
tk-7570fbe3b848f0d05b9b16849ec6d24ca5ef899f.tar.gz
tk-7570fbe3b848f0d05b9b16849ec6d24ca5ef899f.tar.bz2
-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)) {