|
From: Daniel J S. <dan...@ie...> - 2006-04-10 04:16:36
|
Ethan A Merritt wrote:
> On Sunday 09 April 2006 05:14 pm, Daniel J Sebald wrote:
>
>>For an X11 window there can't be two clients desiring the ButtonPress
>>event at the same times.
>
>
>>The external client that created the window may or may not have requested
>>ButtonPress via ButtonPressMask.
>
>
> That would clearly be a programming error. Why open a window for the purpose
> of displaying gnuplot output, and then fail to let gnuplot have access to the
> window events?
Well, not necessarily. Maybe someone likes the cursor position information but wants a button press to be interpreted by the parent application to load some new data and replot. I don't know. It boils down to what can accomplish. Can't defy X11 behavior. If there were no documentation about this option, it would be likely the programmer of the outside application might never understand the problem even though it may be their "error".
>
>
>>If it did and gplt_x11.c attempts to also set ButtonPressMask, the window will crash.
>
>
> Seems unlikely.
> Shouldn't you just get an error return from the call to XSelectInput?
No, I'm fairly certain I tried this. I wouldn't have added this "b" option if all that would happen is some kind of benign error value. The system does something bad, from what I remember. (I can probably force it with an internal code change just to test out.) From what I remember, when two clients want the ButtonPress the plot would appear and then clicking in the window would cause the window to go away.
>
>
>>The "b", "B" option is a solution that may not be elegant, but it works.
>>It could be changed and placed under {un}set mouse if ever we find an X11 expert.
>
>
> How do you know it works, if the tcl demo you have either crashes or
> prevents mousing?
In the past I have tried this manually. There are some utilities to print out the XID for a window. I'd create a window in some application that doesn't use a mouse, use the utility to print out the XID and then manually type the XID into the command line. It worked. (I left a note in gpdemos.tcl.)
> Sounds to me like the mousing code is basically untested.
> Do you have another demo that does work?
No, but I think it is behaving as one might expect. Wait until I get my patch set up on SourceForge and we'll revisit its behavior.
Dan
|