[GRASS5] Windows native Xdriver

Glynn Clements glynn.clements at virgin.net
Wed May 1 19:08:08 EDT 2002


Mike Thomas wrote:

> > I can think of one change which might cause this. When no client is
> > connected, XDRIVER no longer polls the monitor socket; instead, it
> > uses select() to wait until either a client connects, or until an
> > event can be read from the connection to the X server.
> >
> > For this to work with libW11, the descriptor returned by
> > ConnectionNumber() would have to be readable according to select().
> >
> > Currently, libW11/w32/xlib.c has:
> >
> > int
> > XConnectionNumber(Display* display)
> > {
> > int fd;
> > NT_debug ("XConnectionNumber\n");
> > fd = open ("/tmp/windows", O_NONBLOCK, 0);
> > return 999;
> > }
> >
> > This won't work, but returning "fd" might.
> 
> I was afraid you might say this, as I was getting nonsense from the call to
> open() when I tried returning the fd instead of 999 (and also in a small
> test program which I am following up in more detail).

I'm wondering if this code was meant to open "/dev/windows" instead.

I've committed a change which uses /dev/windows. This works at first,
but eventually XDRIVER dies. I'd appreciate feedback on what happens
on NT/2K/XP, in case this is another Win9x bug.

Note: nothing should actually be read from /dev/windows. The
descriptor returned by XConnectionNumber() is passed to select(), in
get_connection_sock(), and in Get_Xevent(). Both of these functions
use select() to wait until either the monitor socket or the X
connection become readable.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list