gs on MacOS X in R9B-0

Sean Hinde <>
Wed Oct 23 21:44:57 CEST 2002


Well.

> My diff to Tk follows.

CPSEnableForegroundOperation() returns err=1010 if subsequently another
window is brought into the foreground and then the toolbar window clicked
again. Ignoring the return value from this call does allow the gs window to
be brought back into the foreground so (in the absence of any Apple
documentation on the subject) my feeling is to simply assume that this call
is successful :)

Alternative patch follows.

Sean

--- macosx/tkMacOSXMouseEvent.c.orig	Wed Oct 23 19:17:39 2002
+++ macosx/tkMacOSXMouseEvent.c	Wed Oct 23 20:38:44 2002
@@ -59,6 +59,9 @@
 #include "tkPort.h"
 #include "tkMacOSXDebug.h"
 
+extern OSErr 	CPSSetProcessName ( ProcessSerialNumber *psn, char
*processname);
+extern OSErr 	CPSEnableForegroundOperation( ProcessSerialNumber *psn,
UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+
 typedef struct {
     WindowRef      whichWin;
     WindowRef      activeNonFloating;
@@ -250,7 +253,13 @@
             return 1;
         } else {
             if (!flag) {
-                if ((err=SetFrontProcess(&ourPsn)) != noErr) {
+	      if ((err=CPSSetProcessName(&ourPsn,"GS")) != noErr) {
+		  fprintf(stderr, "CPSSetProcessName failed, %d\n", err);
+		  statusPtr->err = 1;
+		  return 1;
+	      }
+	      CPSEnableForegroundOperation(&ourPsn,0x03,0x3C,0x2C,0x1103);
+	      if ((err=SetFrontProcess(&ourPsn)) != noErr) {
                     fprintf(stderr,"SetFrontProcess failed,%d\n", err);
                     statusPtr->err = 1;
                     return 1;



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list