|
From: Daniel J S. <dan...@ie...> - 2004-09-06 22:37:51
|
Dave Denholm wrote:
>Daniel J Sebald <dan...@ie...> writes:
>
>
>
>>Yes, seen that.... I understand that X windows are fundamentally the
>>same, but obviously something isn't right here. Perhaps it has
>>something to do with the input/output you mention... The only extra
>>bit of info I can provide is that the window that gnuplot_x11 connects
>>to doesn't die until in the main loop. (That doesn't mean what was
>>done in pr_window() isn't the cause of the failure... just that it
>>doesn't manifest itself untill later... *perhaps*.) It is the
>>commands XFlush() and XPending() that cause the exterior window to
>>crash. But notice those only have the display as an input. Could it
>>be that those commands have to do with input/output, and the exterior
>>X window is not input/output? But that doesn't make sense, X wouldn't
>>be set up to be so fragile.
>>
>>
>>
>
>Ah - bear in mind that Xlib tends to buffer everything up until
>XFlush(). So it is only when you XFlush() that *all* the other
>activity happens !
>
>There is a mode you can set to make xlib synchronous.
>
>XSynchronize(dpy, 1);
>
>what that does is that after every xlib call, it does an XSync() to
>force a round-trip request. Any errors caused by the request (or other
>side effects such as crashing other client !) are gauranteed to happen
>before the xlib call completes.
>
Getting close here, Dave. I commented out the ProcessEvents() function
in pr_window(), which contains
static void
ProcessEvents(Window win)
{
XSelectInput(dpy, win, KeyPressMask | KeyReleaseMask
| StructureNotifyMask | PointerMotionMask | PointerMotionHintMask
| ButtonPressMask | ButtonReleaseMask | ExposureMask |
EnterWindowMask);
XSync(dpy, 0);
}
After that, plotting to X windows is fine; but of course without this
the mouse and resizing don't work. So right now I'm reading the man
XSelectInput to find out what the conflict is.
Dan
|