discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to reconnect to a new X Server


From: Sebastian Reitenbach
Subject: Re: How to reconnect to a new X Server
Date: Wed, 22 May 2013 18:10:25 +0200
User-agent: SOGoMail 2.0.5a

 
On Wednesday, May 22, 2013 15:30 CEST, Stefan Bidi <stefanbidi@gmail.com> 
wrote: 
 
> I'm not very familiar with AppKit programming, but can't you just call
> [NSApplication-run] yourself in a while loop?  You'd probably have to do
> all the setup that NSApplicationMain() does before and after calling it,
> but if it works the way I think it should, you wouldn't need a wrapper
> binary.
> 
> Just an idea.

I tried that, but that did not worked out.
I now added a loginpaneld daemon, starting the loginpanel application.
When the loginpanel dies, or the Xserver, then it respawns it, like I wanted
to have it.

IF somebody want to try it:
cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/gap co 
gap/system-apps/loginpanel

but beware, I only developed on OpenBSD, where it works for me.
So it may or may not work for you ;)

When it installs, stop the X server, and run loginpaneld as root from a console.

To let the Info Panel have window decorations, you should add the default to 
roots account:
NSGlobalDomain GSX11HandlesWindowDecorations NO

comments/ideas/bug reports/... are welcome.

cheers,
Sebastian

> 
> Stef
> 
> 
> On Wed, May 22, 2013 at 7:40 AM, Sebastian Reitenbach <
> sebastia@l00-bugdead-prods.de> wrote:
> 
> >
> > On Wednesday, May 22, 2013 11:55 CEST, "Dr. H. Nikolaus Schaller" <
> > hns@goldelico.com> wrote:
> >
> > >
> > > Am 22.05.2013 um 11:34 schrieb Sebastian Reitenbach:
> > >
> > > > 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?
> > >
> > > I think what you are looking for should be done in the startx or xinit
> > scripts of
> > > your system. They are usually responsible for restarting X servers. Also
> > > initd and its run-levels play some role.
> > >
> > > So the loginpanel should also be restarted by the same mechanism.
> > > I.e. you could try to make it sort of a display and/or window manager.
> >
> > I thought more the lines of XDM, when the X server it spawns gets killed,
> > its restarting it, showing the login greeter again.
> >
> > I looked at Login.app from mGSTEP as an example:
> > http://www.illumenos.com/os/mgstep/projects.html
> >
> > I could write an init script , that runs the while (1) loop, and restarts
> > every time. Otherwise, I could potentially just write a wrapper binary,
> > which
> > execve() the application in a while loop.
> >
> >
> > Sebastian
> >
> > >
> > > Nikolaus
> >
> >
> >
> >
> >
> > _______________________________________________
> > Discuss-gnustep mailing list
> > Discuss-gnustep@gnu.org
> > https://lists.gnu.org/mailman/listinfo/discuss-gnustep
> >
 
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]