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

Кулешов Алексей rndfax at yandex.ru
Tue Mar 25 02:28:54 PDT 2014


I didn't mention, but i use ncurses for visualization.

> 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.

I'm not expert in terminal state machines,
so may be this is really necessary to call tsm_screen_draw on every tsm_vte_input,
though for the first view it seems like overhead.

>>  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.

Okay.

>>  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.

Since i use ncurses, RGB is not an option for me.
My point is may be put some explanation to libtsm.h about fccode & bccode?
Like 'enum vte_color { ... }' or something?

>>  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.

Garbage in attachment. What i do in my program:
1) make tsm screen small enough so that all output will be in one column
2) ls /usr/bin
3) enlarge tsm screen (tsm_screen_resize, resize/clear ncurses window and call tsm_screen_draw)
4) tsm_screen_sb_up + tsm_screen_draw
5) all what not in the first column is garbage
-------------- next part --------------
A non-text attachment was scrubbed...
Name: garbage.png
Type: image/png
Size: 20654 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/kmscon-devel/attachments/20140325/f6822561/attachment-0001.png>


More information about the kmscon-devel mailing list