aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-12 10:56:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-12 10:56:10 +0000
commit2bdd0a7c80837d7289f73c1247898c8423a2368c (patch)
treec26338e22a9840d8eaef8dbc29c24c8e494da0b2 /scripts
parentchangelog: hollow cursor is now based on keyboard focus, not visual focus (diff)
render: remove most of the special handling of cursor rendering
Previously, we had to explicitly render the old cursor cell *before* applying scrolling damage. We then rendered all the dirty rows, *without* rendering the cursor - even if the cursor cell was among the dirty rows. Finally, when everything else was done, we explicitly rendered the cursor cell. This meant a lot of code, and unnecessary render_cell() calls, along with unnecessary wl_surface_damage_buffer() calls. This was a necessary in the early design of foot, but not anymore. We can simply mark both the old cursor cell, and the current one, as dirty and let the normal rendering framework render it. All we need to do is pass the cursor column to render_row(), so that it can pass has_cursor=true in the appropriate call to render_cell(). We pass -1 here for all rows, except the cursor's row, where we pass the actual cursor column. With this, there's no need to calculate whether the cursor is visible or not; just mark it's cell as dirty, and if that row is visible, the normal rendering will take care of it. This also simplifies the state needed to be saved between two frames; we only need a row pointer, and the cursor column index. Part of https://codeberg.org/dnkl/foot/issues/35
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions