gs on MacOS X in R9B-0

Sean Hinde <>
Wed Oct 23 21:15:51 CEST 2002


> > Or failing that any other ideas?
> 
> I think this has already been solved in the ESDL driver. 
> Something like
> this should do the trick, but take a closer look in 'esdl_driver.c for
> the details.
> 
>       err = CPSGetCurrentProcess(&PSN);
>       assert(!(err = CPSSetProcessName(&PSN,"ESDL")));
>       assert(!(err =
> CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)));     
> assert(!(err = CPSSetFrontProcess(&PSN)));

Well I just hacked the extra lines into tkMacOSXMouseEvent.c and it works..
Trying to select a menuitem causes a gs crash but we're now in the
foreground at least. All we need now is a groovy GS icon :)

My diff to Tk follows - I cheated a bit by not including the whole CPS.h and
assuming type compatibility of CPSProcessSerNum.

Thanks again

Sean

--- macosx/tkMacOSXMouseEvent.c.orig	Wed Oct 23 19:17:39 2002
+++ macosx/tkMacOSXMouseEvent.c	Wed Oct 23 20:06:34 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,18 @@
             return 1;
         } else {
             if (!flag) {
-                if ((err=SetFrontProcess(&ourPsn)) != noErr) {
+	      if ((err=CPSSetProcessName(&ourPsn,"ESDL")) != noErr) {
+		  fprintf(stderr, "CPSSetProcessName failed, %d\n", err);
+		  statusPtr->err = 1;
+		  return 1;
+	      }
+	      if ((err =
CPSEnableForegroundOperation(&ourPsn,0x03,0x3C,0x2C,0x1103)) 
+		     != noErr) {
+		  fprintf(stderr, "CPSEnableForegroundOperation failed,
%d\n", err);
+		  statusPtr->err = 1;
+		  return 1;
+	      }
+	      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