[kmscon-devel] [PATCH]: scroll back functions: return how many lines were scrolled back

David Herrmann dh.herrmann at gmail.com
Mon Mar 24 12:18:02 PDT 2014


Hi

On Mon, Mar 24, 2014 at 4:43 PM, rndfax <rndfax at yandex.ru> wrote:
> But still, since this mail-listing is alive (i saw only spam :)):
>
> 1) as i understood there is no function to get the actual age of the screen.
> So may be there should be tsm_screen_get_age (or tsm_screen_is_dirty)?
> (after tsm_vte_input it's better to know whether to call tsm_screen_draw or not)

On _every_ tsm_vte_input() you need to call tsm_screen_draw(). Only
tsm_vte_keyboard() does some input validation and returns whether a
redraw is needed.

> 2) tsm_screen_draw returns age, and this age only used in draw_cb.
> Is it possible to call draw_cb only on updated cells?
> If so, then age will become internal.

It's your responsibility to use the passed age to verify against your
framebuffer-age. If it's smaller or equal, you can skip rendering that
cell. Note that there is little gain in dropping these function calls
and doing the age-comparison inside of TSM. We have to do it
somewhere.. if the function calls turn out to be too heavy, we can
reconsider that. But until then, I think this is fine.

> 3) character colors: fccode and bccode what are they?
> If i see fccode = 4, bccode = 3 then what colors should i display?

The fccode/bccode color-codes are converted to RGB inside of libtsm,
so you can just use fr/fg/fb and /br/bg/bb. The term-codes are only
provided for compatibility in case you want different color-schemes.

> 4) and scroll-back buffer.
> I make my window small, draw some huge text and then make my window bigger and then use scroll back to see above text.
> And i see garbage where there were no text.
> It seems like tsm calls malloc/realloc but not zeroing the added memory (or my hands are too bent).

Hm, what kind of garbage? Can you create a screen-shot? My wlterm
example works fine.

Thanks
David


More information about the kmscon-devel mailing list