-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan Kost wrote:

> A second but more complex idea is to use an virtual frame-buffer like: 
>  /usr/X11R6/bin/Xvfb -ac :9 -screen 9 1024x786x16
> 
> And the setting this display as the default one before opening any
> window. Unfortunately this involves
> 1) setting up the virtual display from the test suite
> 1a) either checking if its already up and using it
> 1b) finding a 'free' display number, using it and afterwards teminate it
> 2) redirecting the app there
> 
> I have no idea wheter 1a) or 1b) is more practical, both sound tricky.

I'd say 1b is probably easier.  You can check two places for a free display:

/tmp/.X11-unix/:
Each new display creates a new socked called "X##" here (where ## is the
display number).  So if you just try numbers until one doesn't exist,
you can use that one.

/tmp/.X##-lock:
This is just a lockfile that the X server creates to say "hey, I'm using
this display".  Same deal, just find a lockfile that doesn't exist (ok,
that's a bit paradoxical), and use that number.

Of course, there could be a race condition between checking for a file
and starting up the X server, but I'm guessing (hoping) that you're not
planning on starting a bunch of these all at the same time.
        -brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFC4ZJh6XyW6VEeAnsRAnmTAKC1FrPOLeGtawx1H5IuUokIjdsx5QCfblrD
YOk2GAYgTn/pGA4sLnKUXM0=
=19ed
-----END PGP SIGNATURE-----
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to