wineconsole (Eric?) problem

Ann and Jason Edmeades us at the-edmeades.demon.co.uk
Tue Apr 30 16:20:55 CDT 2002


Hi again,

Another bug I have spotted can be demonstrated clearly by dir /s /w on wcmd
on a small set of directories a couple of times (once my patch for /w is
on). The first time it writes to the screen without scrolling and all is ok,
the second time as it scrolls, it misses off 'Total files listed' and 'bytes
free' two lines near the bottom.

Basically the wineconsole is not being updated 100% correctly and skips some
lines. Looking closely at the wineconsole code (by dumping out the screen at
each event) I have worked out what is going on, but am not 100% sure about
the 'proper' way to fix it.

The problem is the console routines generally generate a sequence of events
(assume an n line screen)
v-scroll(x)       (Make the xth line of the buffer the top line)
update(x+n, x+n)  (Write to the new bottom line of the screen)

In the failing case I see

v-scroll(x)           (Make the xth line of the buffer the top line)
update(x+n, x+n)      (Write to the new bottom line of the screen)
update(x+n+2, x+n+3)  (Write beyond the bottom line of the screen)

Although the data is retrieved correctly, it never gets displayed (An
invalidaterect appears to happen)


A simple way of avoiding this is to update wineconsole as follows:
	case CONSOLE_RENDERER_UPDATE_EVENT:
	    Trace(1, " update(%d,%d)", evts[i].u.update.top,
evts[i].u.update.bottom);

        /* test fix - Force updates to occur on visible screen */
        if ((data->curcfg.win_pos.Y+data->curcfg.win_height) <
evts[i].u.update.bottom) {
            Trace(1, " Forced vscroll \n");
            data->fnScroll(data, evts[i].u.update.bottom -
data->curcfg.win_height, FALSE);
            data->fnPosCursor(data);
        } else if (data->curcfg.win_pos.Y > evts[i].u.update.top) {
            Trace(1, " Forced vscroll2 \n");
            data->fnScroll(data, evts[i].u.update.top, FALSE);
            data->fnPosCursor(data);
        }

	    WINECON_FetchCells(data, evts[i].u.update.top,
evts[i].u.update.bottom);

The question is, is this correct, or is the server generating incorrect
events, is the refresh not occurring properly etc?

Thoughts please?
Regards,
Jason

jason @ the-edmeades.demon.co.uk




More information about the wine-devel mailing list