summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2006-08-18 07:47:25 (GMT)
committerdas <das>2006-08-18 07:47:25 (GMT)
commitdc316587c0b9053c09dfb532523bcdfd73169adc (patch)
treef254078a6fbdec5ff6dc35a289513a269d6227f6 /macosx
parent5ee6ad27caa9604bea6497f069083d463a106d80 (diff)
downloadtk-dc316587c0b9053c09dfb532523bcdfd73169adc.zip
tk-dc316587c0b9053c09dfb532523bcdfd73169adc.tar.gz
tk-dc316587c0b9053c09dfb532523bcdfd73169adc.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.13 * macosx/README: updates for x86_64 support in Tcl. * 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]
Diffstat (limited to 'macosx')
-rw-r--r--macosx/README22
-rw-r--r--macosx/tkMacOSXInit.c42
-rw-r--r--macosx/tkMacOSXMenu.c3
-rw-r--r--macosx/tkMacOSXMenus.c3
-rw-r--r--macosx/tkMacOSXMouseEvent.c8
-rw-r--r--macosx/tkMacOSXWm.c19
6 files changed, 58 insertions, 39 deletions
diff --git a/macosx/README b/macosx/README
index 6ec0b55..b0d4a31 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
Tcl/Tk Mac OS X README
----------------------
-RCS: @(#) $Id: README,v 1.6.2.12 2006/07/21 06:03:24 das Exp $
+RCS: @(#) $Id: README,v 1.6.2.13 2006/08/18 07:47:25 das Exp $
This is the README file for the Mac OS X/Darwin version of Tcl/Tk.
@@ -166,19 +166,19 @@ build of the tcl/macosx/Tcl.pbproj project.
- To build universal binaries, set CFLAGS as follows:
export CFLAGS="-arch ppc -arch i386 \
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
-This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on
-any of the architectures (on intel Macs, the -isysroot is not required).
-Note that it is not possible to configure correctly if the current architecture
-is not present in CFLAGS (i.e. -arch `arch` must always be there).
+This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on any
+of the architectures (on intel Macs, the -isysroot may not be required). Note
+that it is not possible to configure universal builds correctly if the current
+architecture is not present in CFLAGS (i.e. -arch `arch` must be there).
Universal builds of Tk TEA extensions are also possible with CFLAGS set as
above, they will be [load]able by universal as well as thin binaries of Tk.
-Note that while Tcl can be built for the ppc64 architecture, neither TkAqua nor
-TkX11 can be built with -arch ppc64 as the corresponding GUI libraries are not
+Note that while Tcl can be built for 64-bit architectures, neither TkAqua nor
+TkX11 can be built for 64-bit as the corresponding GUI libraries are not
available for 64bit at present. However, linking a universal 'ppc i386' Tk
-binary against a universal 'ppc ppc64 i386' Tcl binary works just fine.
-The Tk configure script automatically removes '-arch ppc64' from CFLAGS to
-facilitate universal building of both Tcl and Tk with the same CFLAGS setting;
-the same happens with configure in Tk extensions based on TEA 3.5 or later.
+binary against a universal 'ppc ppc64 i386 x86_64' Tcl binary works just fine.
+The Tk configure script automatically removes the 64-bit -arch flags from CFLAGS
+to facilitate universal building of both Tcl and Tk with the same CFLAGS; the
+same happens with configure in Tk extensions based on TEA 3.5 or later.
- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g:
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index b14dff9..e5b6735 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.3.2.17 2006/07/20 06:26:45 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.3.2.18 2006/08/18 07:47:25 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -246,12 +246,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: */
@@ -285,24 +285,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') {
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index c4a0d7f..e194ddb 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.20 2006/07/20 06:27:34 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.21 2006/08/18 07:47:25 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -3695,6 +3695,7 @@ MenuSelectEvent(
{
XVirtualEvent event;
+ bzero(&event, sizeof(XVirtualEvent));
event.type = VirtualEvent;
event.serial = menuPtr->display->request;
event.send_event = false;
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index f996c37..f5c2e1d 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.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: tkMacOSXMenus.c,v 1.2.2.11 2006/07/20 06:27:34 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.2.2.12 2006/08/18 07:47:25 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -241,6 +241,7 @@ GenerateEditEvent(
return;
}
+ bzero(&event, sizeof(XVirtualEvent));
event.type = VirtualEvent;
event.serial = Tk_Display(tkwin)->request;
event.send_event = false;
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 6358141..3e274ed 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.6.2.15 2006/07/20 06:27:34 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.6.2.16 2006/08/18 07:47:25 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -1009,8 +1009,9 @@ GenerateToolbarButtonEvent(MouseEventData * medPtr)
if (!tkwin) {
return true;
}
-
winPtr = (TkWindow *)tkwin;
+
+ bzero(&event, sizeof(XVirtualEvent));
event.type = VirtualEvent;
event.serial = LastKnownRequestProcessed(winPtr->display);
event.send_event = false;
@@ -1019,13 +1020,12 @@ GenerateToolbarButtonEvent(MouseEventData * medPtr)
event.root = XRootWindow(winPtr->display, 0);
event.subwindow = None;
event.time = TkpGetMS();
-
event.x_root = medPtr->global.h;
event.y_root = medPtr->global.v;
event.state = medPtr->state;
event.same_screen = true;
event.name = Tk_GetUid("ToolbarButton");
- Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
return true;
}
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 6a6bf38..b005143 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.30 2006/08/17 01:07:11 hobbs Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.31 2006/08/18 07:47:25 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -963,14 +963,21 @@ static Tcl_Obj *
WmAttrGetTitlePath(WindowRef macWindow)
{
FSRef ref;
- AliasHandle alias;
Boolean wasChanged;
UInt8 path[2048];
- OSStatus err;
+ OSStatus err = fnfErr;
- err = GetWindowProxyAlias(macWindow, &alias);
- if (err == noErr) {
- err = FSResolveAlias(NULL, alias, &ref, &wasChanged);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ if (HIWindowGetProxyFSRef != NULL) {
+ err = HIWindowGetProxyFSRef(macWindow, &ref);
+ }
+#endif
+ if (err != noErr) {
+ AliasHandle alias;
+ err = GetWindowProxyAlias(macWindow, &alias);
+ if (err == noErr) {
+ err = FSResolveAlias(NULL, alias, &ref, &wasChanged);
+ }
}
if (err == noErr) {
err = FSRefMakePath(&ref, path, 2048);