From: Jeremy Huddleston <jeremyhu@berkeley.edu>
Date: December 4, 2007 23:04:27 PST
To: Developer talk about Xquartz <xquartz-dev@lists.macosforge.org>
Subject: Re: [Xquartz-dev] LSBackgroundOnly at runtime
Reply-To: Developer talk about Xquartz <xquartz-dev@lists.macosforge.org>
Hrm... I tried this (needs to be in a separate C file due to type conflicts):
#include <ApplicationServices/ApplicationServices.h>
int moveToForeground() {
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
if( returnCode == 0) {
//SetFrontProcess(&psn);
}
return (int)returnCode;
}
and called moveToForeground() before server_main(). this was added to Info.plist:
<key>LSBackgroundOnly</key>
<true/>
returnCode was 0 (success), but the app didn't show up in the dock. I'm thinking this just won't work and I'm willing to settle with the current situation for now (since it's still better than before)... but still not optimal...
--Jeremy