Re: Fwd: XForms: [PATCH] Double clicking doesn't work in file selectors

From: Angus Leeming (angus.leeming@btopenworld.com)
Date: Fri May 30 2003 - 06:57:43 EDT

  • Next message: Angus Leeming: "Re: XForms: the missing fl_lookup_RGBcolor()"

    # To subscribers of the xforms list from Angus Leeming <angus.leeming@btopenworld.com> :

    On Saturday 24 May 2003 3:45 pm, Mike Heffner wrote:
    > On 04-May-2003 Angus Leeming wrote:
    > | - clicked = (clicked || xev->type == ButtonPress);
    > | + clicked = (clicked || xev->type == ButtonPress || xev->type ==
    > | MotionNotify
    >
    > Looking at this code again, when you click the mouse on any item in the
    > Browser, the callback (select_cb) will always be called with the event
    > type MotionNotify. I put a single printf at the top of that function and I
    > never got a ButtonPress event. Possibly the MotionNotify events
    > are happening so quickly they hide the ButtonPress events read from
    > fl_last_event? Is anyone using fl_last_event() to read ButtonPress events?
    > The file selector appears to be the only code in the entire xforms lib
    > that uses it.
    >
    > So, currently testing for MotionNotify in the select_cb is all I can think
    > of.

    Mike, it strikes me that the logic of the above line is entirely wrong.
    clicked is changed if any random XEvent is passed but it should respond only
    to ButtonPress events. Shouldn't it be:

    - clicked = (clicked || xev->type == ButtonPress);
    + if (xev->type == ButtonPress) clicked = 1;

    Regards,
    Angus

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/
    Development: http://savannah.nongnu.org/files/?group=xforms



    This archive was generated by hypermail 2b29 : Fri May 30 2003 - 05:57:42 EDT