Launching a GUI using execl()
Launching a GUI using execl()
- Subject: Launching a GUI using execl()
- From: Rakesh Singhal <email@hidden>
- Date: Wed, 25 Feb 2009 03:37:07 +0530
Hi all,
I am launching a GUI app from daemon app as following:
pid_t Pid = 0;
Pid = fork();
setsid();
if (Pid == -1)
{
printf("fork err(%d)-%s\n", errno, strerror(errno));
return false;
}
else if(Pid == 0)
{
retValue = execl(GUI_PATH, GUI_PATH, PortNumber, (char*)0);
if(retValue == -1)
{
printf("execl err(%d)-%s\n", errno, strerror(errno));
return false;
}
}
When I execute this code, it launches the GUI every time but sometimes
properly and sometimes not properly. Not properly means here, when it
launches I face following issues:
1. I can not go to GUI using command + tab, cause it does not show there.
2. When it launches, it does not show on front of all applications.
3. I can not quit it using command + q, if I try command + q, it
terminates other GUI application which is also running on system. I
can use mouse to click on red cross to close it or from activity
monitor, I can quit it.
I do not faces these issues when it launches it properly.
I can not use launch services APIs cause LaunchServices framework is
not daemon safe.
Please advice.
Regards
rksinghal
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden