|
From: Daniel J S. <dan...@ie...> - 2006-04-10 00:05:49
|
Ethan A Merritt wrote:
> On Sunday 09 April 2006 12:26 pm, Daniel J Sebald wrote:
>
>>1) "b" for "buttonable".
>>If no "b" appears gnuplot's mouse cursor will still move around but will not respond to clicks.
>>
>>2) "m" for "mousable",
>>If no "m" appears have gplt_x11.c also disable the mouse activity for that window so the cursor will not even move.
>>
>>Can anyone conceive of a need for (1)?
>
>
> I don't see a need for any of that.
> What's wrong with '{un}set mouse'?
For an X11 window there can't be two clients desiring the ButtonPress event at the same times. See
http://tronche.com/gui/x/xlib/event-handling/XSelectInput.html
last bullet point in the list. The external client that created the window may or may not have requested ButtonPress via ButtonPressMask. If it did and gplt_x11.c attempts to also set ButtonPressMask, the window will crash.
So gnuplot needs to be told whether it is OK to take control of the ButtonPress events.
Now, this could be eliminated if there were some way to inquire from within gplt_x11.c if there is or isn't some outside client who has control of the ButtonRelease event. In that case, the functionality could be placed under {un}set mouse. I've looked, but none of the routines in the windowing functions give such a solution. Perhaps there is some other Xlib routine for looking at processes and so on.
Here is about the closes thing I could find:
http://tronche.com/gui/x/icccm/sec-4.html
4.1.7. Input Focus
There are also routines that read like they might be worthwhile:
http://www.xfree86.org/current/XGrabButton.3.html
but I'm just not sure if these means to take hold of the ButtonPress events. But somehow I just think that an outside client can't override the ButtonPress of some parent client.
So, it's a lot work to find out the proper method of forcing control of ButtonPress (or even determining if an outside client has control of ButtonPress events). 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.
Dan
|