buffer: remove buffer->cairo

It's more common for cairo_t to have a temporary lifetime and it will
prevent accidentally reusing its previous state.
This commit is contained in:
tokyo4j 2024-11-28 06:58:17 +09:00 committed by Hiroaki Yamamoto
parent c48324975d
commit 4502d58eec
8 changed files with 39 additions and 22 deletions

View file

@ -90,7 +90,7 @@ _osd_update(struct server *server)
continue;
}
cairo = buffer->cairo;
cairo = cairo_create(buffer->surface);
/* Background */
set_cairo_color(cairo, theme->osd_bg_color);
@ -150,6 +150,7 @@ _osd_update(struct server *server)
g_object_unref(layout);
surface = cairo_get_target(cairo);
cairo_surface_flush(surface);
cairo_destroy(cairo);
if (!output->workspace_osd) {
output->workspace_osd = wlr_scene_buffer_create(