[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to reconnect to a new X Server
From: |
Moon Elf |
Subject: |
Re: How to reconnect to a new X Server |
Date: |
16 Dec 2013 12:28:40 GMT |
User-agent: |
slrn/1.0.1 (Linux) |
On 2013-05-22, Sebastian Reitenbach <sebastia@l00-bugdead-prods.de> wrote:
> 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
>
>
I think you better use the C interface to X, I've written a small self-managed
window app which displays on an X server, the code is here :
http://sf.net/projects/jackassbotchx/
You can also try to read the Xlib programming manual.
Then, when using while (1) { /**/ } try to use an interrupt such as an XEvent
(see my tarballed code above) or custom items.
ME
--
Member of the DR rogue circle.
Search and you will find.
- Re: How to reconnect to a new X Server,
Moon Elf <=