[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to reconnect to a new X Server
From: |
Sebastian Reitenbach |
Subject: |
How to reconnect to a new X Server |
Date: |
Wed, 22 May 2013 11:34:30 +0200 |
User-agent: |
SOGoMail 2.0.5a |
Hi,
working with Riccardo on GAPs loginpanel, made some progress, but ran into
trouble now.
What I do is starting the X Server, before I then start the loginpanel
application.
Then the loginpanel actually has an X server running, where it can connect to.
So far, that works well. I can login. When I logout, then I am killing the X
server, and
want to restart it, and spawn the loginpanel again.
First I tried in loginpanels main function:
while (1)
{
[XManager startXServer];
putenv("DISPLAY=:0.0");
NSApplicationMain(argc, argv);
}
That probably was too naive from me thinking it might work ;) Reading up
NSApplication
documentation, I see that everything after NSApplicationMain(argc, argv); will
not be
exectuted, so the while loop will only runs once :(
Anyways, then I tried to start the XServer again, after I teared it down.
That works so far, but when the loginpanel wants to reset its window on the X
server,
I see it crying on the console, that the connection to the XServer broke:
X connection to :0.0 broken (explicit kill or server shutdown)
Even if there is a new server spawned already on the same display.
Is there a way to tell the application that the X Server disappeared, and it
should reconnect to the new one? Or tell it to kind of respawn itself?
cheers,
Sebastian
- How to reconnect to a new X Server,
Sebastian Reitenbach <=