[winGRASS] Re: generic Windows GRASS driver
Glynn Clements
glynn.clements at virgin.net
Thu Sep 20 10:34:21 EDT 2001
Mike Thomas wrote:
> Debugging the libW11 version of the XDriver - the exposition of my logic may
> be a little laborious, but I am coming to grips with the differences between
> X11 and Windows from behind the pole position.
>
> OK - further to the report below, it seems that the libW11 display window
> closes down as soon as the parent XDRIVER exits - that is, when the message:
>
> Graphics driver [x0] started - exiting
>
> appears.
>
> My interpretation of this is that the new window is not running as a
> separate process and therefore is doomed to die with the process that
> launches it (ie the parent XDriver).
>
> I assume that this is not the case with X11 - that is, that the window is
> under the control of the XServer rather than the XDriver and is therefore
> preserved.
Yep. The child process inherits the descriptor which is the connection
to the X server, allowing it to continue from where the parent left
off.
> On this basis I used the __W98__ define to stop the parent from exiting.
> This buys a display which waits for a response (looping on do_work(0)).
You would also need to disable the fork(). Not only is the child
process is of no use (as it can't make use of the window which the
parent created), it will interfere with the parent (as it will be
reading from the control socket, "stealing" data which should be read
by the parent).
This simplest way to avoid the fork is to add the following at an
appropriate point in main.c:
#ifdef __W98__
foreground = 1;
#endif
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-windows
mailing list