XForms: A question about xpopup.c:handle_motion

From: Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
Date: Wed Apr 09 2003 - 11:45:18 EDT

  • Next message: Angus Leeming: "Re: XForms: [patch] moving tabfolder-specific code out of forms.c"

    # To subscribers of the xforms list from Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> :

    The beginning of handle_motion reads like:

    static MenuItem *
    handle_motion(PopUP * m, int mx, int my, int *val)
    {
        int cval;
        MenuItem *item = 0;
        int titleh = m->titleh;
        static MenuItem *lastitem;

        cval = (mx < 0 || mx > m->w) ? -1 : ((my - titleh + m->cellh) / m->cellh);

        /* if released on title bar, cval is zero. However, if there is no title,
           change cval to -1 (invalid) if "too right" */

        if (cval == 0 && (!m->title || !*m->title))
            cval = (mx > m->w / 3) ? -1 :
                ((puplevel > 1 && mx < m->x) ? -1 : 0);
    [...]

    The reason I am looking at that is the annoying menu bug that LyX has.
    It seems that the problem is the test (mx > m->w / 3), which means
    that the menu is removed only if one clicks on the right 2/3 of the
    menu. This seems bizarre to me and I plan to remove this test.

    Now, when I try to understand the second test, I am a bit lost. It
    seems to me that mx is a coordinate relative to the popup. So what
    sense does it make to compare it to m->x?

    Actually, LyX has a bug where, when one clicks on several submenus in
    a row, all of them stay on screen. I suspect that the reason is around
    here, but I would like first to make sense of the existing code.

    Any thoughts?

    JMarc
    _________________________________________________
    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 : Wed Apr 09 2003 - 11:47:21 EDT