c# - Launching an OSX process without a dock icon -
i have 2 unity3d applications - 1 launched other, -batchmode argument on launched 1 has no graphics.
on mac osx launched process still gets dock icon sits there bouncing forever; clicking nothing since it's non-graphical, , i'd remove it.
i've tried modifying info.plist lsuielement entry rid of dock icon. works if launch application myself, still gets dock icon when launch process.
my process launching code little unusual mightn't helping. works on windows , linux not osx , i'm not sure why (c#, mono):
processstartinfo proc = new processstartinfo(); proc.filename = path + filename; proc.workingdirectory = path; proc.arguments = commandlineflags; process = process.start(proc);
i've got launch on osx specific setup:
processstartinfo startinfo = new processstartinfo("open", "-a '" + path + filename + "' -n --args " + commandlineflags); startinfo.useshellexecute = false; process = process.start(startinfo);
you need monomac if not using it, either older open-source version or commercial version (xamarin.mac).
in unity app launching 'sub-process' first app add project reference monomac , add using clause monomac:
using monomac;
then in static main function:
monomac.appkit.nsapplication.init (); monomac.appkit.nsapplication.sharedapplication.activationpolicy = monomac.appkit.nsapplicationactivationpolicy.accessory;
that hide application/process dock , task switcher... of course can conditional skip code if running on windows/linux.
Comments
Post a Comment