mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
render: move frame_callback to term.render
This commit is contained in:
parent
ebf0a11fa0
commit
4838763d18
3 changed files with 11 additions and 9 deletions
4
main.c
4
main.c
|
|
@ -848,8 +848,8 @@ out:
|
||||||
mtx_unlock(&term.kbd.repeat.mutex);
|
mtx_unlock(&term.kbd.repeat.mutex);
|
||||||
|
|
||||||
shm_fini();
|
shm_fini();
|
||||||
if (term.frame_callback != NULL)
|
if (term.render.frame_callback != NULL)
|
||||||
wl_callback_destroy(term.frame_callback);
|
wl_callback_destroy(term.render.frame_callback);
|
||||||
if (term.wl.xdg_toplevel != NULL)
|
if (term.wl.xdg_toplevel != NULL)
|
||||||
xdg_toplevel_destroy(term.wl.xdg_toplevel);
|
xdg_toplevel_destroy(term.wl.xdg_toplevel);
|
||||||
if (term.wl.xdg_surface != NULL)
|
if (term.wl.xdg_surface != NULL)
|
||||||
|
|
|
||||||
12
render.c
12
render.c
|
|
@ -563,9 +563,9 @@ grid_render(struct terminal *term)
|
||||||
cairo_surface_flush(buf->cairo_surface);
|
cairo_surface_flush(buf->cairo_surface);
|
||||||
wl_surface_attach(term->wl.surface, buf->wl_buf, 0, 0);
|
wl_surface_attach(term->wl.surface, buf->wl_buf, 0, 0);
|
||||||
|
|
||||||
assert(term->frame_callback == NULL);
|
assert(term->render.frame_callback == NULL);
|
||||||
term->frame_callback = wl_surface_frame(term->wl.surface);
|
term->render.frame_callback = wl_surface_frame(term->wl.surface);
|
||||||
wl_callback_add_listener(term->frame_callback, &frame_listener, term);
|
wl_callback_add_listener(term->render.frame_callback, &frame_listener, term);
|
||||||
|
|
||||||
wl_surface_commit(term->wl.surface);
|
wl_surface_commit(term->wl.surface);
|
||||||
|
|
||||||
|
|
@ -585,9 +585,9 @@ frame_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_da
|
||||||
{
|
{
|
||||||
struct terminal *term = data;
|
struct terminal *term = data;
|
||||||
|
|
||||||
assert(term->frame_callback == wl_callback);
|
assert(term->render.frame_callback == wl_callback);
|
||||||
wl_callback_destroy(wl_callback);
|
wl_callback_destroy(wl_callback);
|
||||||
term->frame_callback = NULL;
|
term->render.frame_callback = NULL;
|
||||||
grid_render(term);
|
grid_render(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -754,6 +754,6 @@ render_update_cursor_surface(struct terminal *term)
|
||||||
void
|
void
|
||||||
render_refresh(struct terminal *term)
|
render_refresh(struct terminal *term)
|
||||||
{
|
{
|
||||||
if (term->frame_callback == NULL)
|
if (term->render.frame_callback == NULL)
|
||||||
grid_render(term);
|
grid_render(term);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -321,7 +321,9 @@ struct terminal {
|
||||||
cairo_font_extents_t fextents;
|
cairo_font_extents_t fextents;
|
||||||
|
|
||||||
struct wayland wl;
|
struct wayland wl;
|
||||||
struct wl_callback *frame_callback;
|
struct {
|
||||||
|
struct wl_callback *frame_callback;
|
||||||
|
} render;
|
||||||
};
|
};
|
||||||
|
|
||||||
void term_damage_rows(struct terminal *term, int start, int end);
|
void term_damage_rows(struct terminal *term, int start, int end);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue