[XForms] incorrect reporting of mouse (XEvent) status to post-handler
Angus Leeming
angus.leeming at btopenworld.com
Mon Jun 14 04:36:33 EDT 2004
On Saturday 12 June 2004 10:38 pm, Ivan Powis wrote:
> I posted this problem a week ago.
Sorry. Been busy.
> In short, in an application
> providing mouse interaction via pre/post handlers
> I notice a spurious response - seemingly xforms detects
> and reports an FL_RELEASE immediately following FL_PUSH event, even
> when the mouse button is still physically held down. This
> completely screws up the ability of the application to track the
> mouse actions. It occurs in version of xforms since 0.89, on
> various OSes. Interestingly it is
> is much more evident on the console of a linux box, than when
> running via a remote X server.
>
> I have at least now tracked the apparent problem to the following
> section of forms.c,
> around line 1357:
>
> #if 1
> /* this is an ugly hack. This is necessary due to popup pointer
> grab where a button release is eaten. Really should do a send event
> from the pop-up routines */
>
> if (fl_pushobj && !button_down(fl_keymask) /* && event ==
> FL_ENTER */ ) {
> obj = fl_pushobj;
> fl_pushobj = NULL;
> fl_handle_object(obj, FL_RELEASE, xx, yy, key, xev);
> }
> #endif
Ahhhhhhhhhhhhhhhh. Evil, isn't it.
> .. in particular it is the call to fl_handle_object which I
> believe initiates the spurious
> FL_RELEASE report to the handlers.
>
> Evidently this section of code comes with a health warning
> attached. Anyone understand what it is trying to do? Wasn't there
> some reference to this same section in a discussion of odd pup-up
> behaviour a few weeks ago?
Yes. I too am being bitten by this block of code. It seems to stem
from the popup code (xpopup.c), which grabs the pointer and the
keyboard and which throws away any genuinely pending XEvents. The
hack tries to limit the damage. The fix would be to do the right
thing in the popups.
I attach my attempt at a fix. Unfortunately, it makes popup behaviour
far worse than it is at the moment, so more needs to be done. Also
unfortunately, I've run out of time for the moment.
Nonetheless, I hope that this info proves valuable. If, in the
meantime, you resolve the problem, then *please* let me know.
Regards,
Angus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: popup.diff
Type: text/x-diff
Size: 3008 bytes
Desc: not available
Url : attachments/20040614/d80960a9/attachment-0010.bin
More information about the Xforms
mailing list