summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authordas <das@noemail.net>2006-08-18 07:47:10 (GMT)
committerdas <das@noemail.net>2006-08-18 07:47:10 (GMT)
commit876340ef9d5cafbbff3bda626880d135d1a156b2 (patch)
treee626c7bc622c86f7865d10e09338df5200f7f124 /macosx/tkMacOSXInit.c
parent3a5e9ac7b524f91079f10829ab389874f58685cc (diff)
downloadtk-876340ef9d5cafbbff3bda626880d135d1a156b2.zip
tk-876340ef9d5cafbbff3bda626880d135d1a156b2.tar.gz
tk-876340ef9d5cafbbff3bda626880d135d1a156b2.tar.bz2
* unix/tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
universal builds including x86_64, for 64-bit CoreFoundation on Leopard and for use of -mmacosx-version-min instead of MACOSX_DEPLOYMENT_TARGET. * unix/configure.in (Darwin): remove 64-bit arch flags from CFLAGS for combined 32-bit and 64-bit universal builds, as neither TkAqua nor TkX11 can be built for 64-bit at present. * unix/configure: autoconf-2.59 * unix/tkConfig.h.in: autoheader-2.59 * macosx/Wish.xcodeproj/project.pbxproj: switch native release targets to use DWARF with dSYM, Xcode 3.0 changes. * macosx/README: updates for x86_64 and Xcode 2.3. * macosx/tkMacOSXInit.c (TkpInit): when available, use public TransformProcessType() API instead of CPSEnableForegroundOperation() SPI to notify the window server that we are a GUI application. * macosx/tkMacOSXWm.c (WmAttrGetTitlePath): use HIWindow API on >=Tiger. * macosx/tkMacOSXMouseEvent.c (GenerateToolbarButtonEvent): * macosx/tkMacOSXMenus.c (GenerateEditEvent): * macosx/tkMacOSXMenu.c (MenuSelectEvent): bzero XVirtualEvent structure before use to ensure all fields are initialized. [Bug 1542205] FossilOrigin-Name: 947c1df30512a72404ed79f107ea82df402f3366
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index a0c2de9..9024697 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.22 2006/07/20 06:24:16 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.23 2006/08/18 07:47:10 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -255,12 +255,12 @@ TkpInit(interp)
}
}
}
-#if MAC_OSX_TK_USE_CPS_SPI
+
/*
* If we are loaded into an executable that is not a bundled application,
* the window server does not let us come to the foreground.
- * For such an executable, we attempt to use an undocumented SPI to
- * notify the window server that we are now a full GUI application.
+ * For such an executable, notify the window server that we are now a
+ * full GUI application.
*/
{
/* Check whether we are a bundled executable: */
@@ -294,24 +294,34 @@ TkpInit(interp)
CFRelease(bundleUrl);
}
- /* If we are not a bundled executable, attempt to use the CPS SPI: */
+ /* If we are not a bundled executable, notify the window server that
+ * we are a foregroundable app. */
if (!bundledExecutable) {
- /*
- * Load the CPS SPI symbol dynamically, so that we don't break
- * if it every disappears or changes its name.
- */
- TkMacOSXInitNamedSymbol(CoreGraphics, OSErr, \
- CPSEnableForegroundOperation, ProcessSerialNumberPtr);
- if (CPSEnableForegroundOperation) {
- ProcessSerialNumber psn = { 0, kCurrentProcess };
+ OSStatus err = procNotFound;
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ if (TransformProcessType != NULL) {
+ err = TransformProcessType(&psn,
+ kProcessTransformToForegroundApplication);
+ }
+#endif
+#if MAC_OSX_TK_USE_CPS_SPI
+ if (err != noErr) {
/*
- * Let the window server know that we are a foregroundable app
+ * When building or running on 10.2 or when the above fails,
+ * attempt to use undocumented CPS SPI to notify the window
+ * server. Load the SPI symbol dynamically, so that we don't
+ * break if it ever disappears or changes its name.
*/
- CPSEnableForegroundOperation(&psn);
+ TkMacOSXInitNamedSymbol(CoreGraphics, OSErr,
+ CPSEnableForegroundOperation, ProcessSerialNumberPtr);
+ if (CPSEnableForegroundOperation) {
+ CPSEnableForegroundOperation(&psn);
+ }
}
+#endif /* MAC_OSX_TK_USE_CPS_SPI */
}
}
-#endif /* MAC_OSX_TK_USE_CPS_SPI */
}
if (tkLibPath[0] != '\0') {