Hopefully some improvement to the 'bring to the foreground'-hack. Please folks, test this on every available platform!

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5634 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2007-01-23 10:27:44 +00:00
parent 5724b00c9a
commit 7401cf37bf
1 changed files with 11 additions and 8 deletions

View File

@ -1267,12 +1267,19 @@ void fl_open_callback(void (*cb)(const char *)) {
* initialize the Mac toolboxes, dock status, and set the default menubar
*/
#ifndef MAC_OS_X_VERSION_10_3
extern "C" {
extern OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn, UInt32 _arg2,
extern OSErr CPSEnableForegroundOperation(ProcessSerialNumber *psn, UInt32 _arg2,
UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
}
#ifndef MAC_OS_X_VERSION_10_3
enum {
kProcessTransformToForegroundApplication = 1L
};
typedef UInt32 ProcessApplicationTransformState;
extern OSStatus TransformProcessType(const ProcessSerialNumber *psn,
ProcessApplicationTransformState transformState);
#endif
}
//#endif
void fl_open_display() {
static char beenHereDoneThat = 0;
@ -1319,15 +1326,11 @@ void fl_open_display() {
if( !bundle )
{
OSErr err = 1;
#ifdef MAC_OS_X_VERSION_10_3
if (TransformProcessType != NULL) {
err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
}
#else
if (CPSEnableForegroundOperation != NULL) {
} else if (CPSEnableForegroundOperation != NULL) {
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
}
#endif
if (err == noErr) {
SetFrontProcess( &cur_psn );
}