Re: XForms: Form Resize Bug

From: Angus Leeming (angus.leeming@btopenworld.com)
Date: Sun Apr 13 2003 - 17:01:18 EDT

  • Next message: Jeff Pierce: "Re: XForms: form with input object cratering app"

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

    On Friday 11 April 2003 3:55 pm, jac@casurgica.com wrote:
    > # To subscribers of the xforms list from jac@casurgica.com :
    >
    > If you resize a form too fast (manually, by dragging the frame with the
    > mouse), the drawing gets all screwed up. The form size doesn't match the
    > window size any more.

    Yeah, it's something that bugs me too. I have filed the bug at
    https://savannah.nongnu.org/bugs/index.php

    I was thinking about this a little over the weekend whilst strolling through
    the fields and lanes of Devon, far, far from a computer. My take on it is
    this. It may of course be totally wrong.

    xforms fields XEvents in form.c's do_interaction_step:

    static XEvent st_xev;
    static void
    do_interaction_step(int wait_io) {
            FL_FORM *evform = 0;
            int has_event;
            has_event = get_next_event(wait_io, &evform, &st_xev);
            ...
            switch (st_xev.type) {
            case ConfigureNotify:
                    /* The dialog is being resized. Reset the metrics info for evform and all
                       its constituent objects. The important step is: */
                    scale_form(evform,
                           (double) st_xev.xconfigure.width / evform->w,
                           (double) st_xev.xconfigure.height / evform->h);
                    break;
            case Expose:
                    /* The time has come to actually render the resized evform */
                    ...
                    fl_handle_form(evform, FL_DRAW, 0, &st_xev);
                    break;
            }
    }

    Now, it strikes me that simply popping the next XEvent off the stack of all
    XEvents can lead to a stack of pending XEvents like:
            ConfigureNotify
            ConfigureNotify
            Expose
            ConfigureNotify
            ConfigureNotify
            Expose
    If we process each one in turn, then that would appear to be needlessly
    wasteful. This may well account for xforms sluggish behaviour when resizing
    the dialog.

    Of course, my hypothesis is not backed up by any evidence. It may be totally
    incorrect. But if it is correct, then a remedial strategy is immediately
    apparent; discard all but the most recent ConfigureNotify and Expose XEvents
    for this particular dialog.

    Are there any X experts out there who can judge whether my suposition is
    reasonable?

    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 : Sun Apr 13 2003 - 15:58:03 EDT