mirror of
https://github.com/jtheoof/swappy.git
synced 2024-08-17 02:30:47 +03:00
fix(render): better handler empty buffer
This commit is contained in:
parent
e8d377fc29
commit
acf2379ba3
10
src/render.c
10
src/render.c
@ -150,6 +150,13 @@ static void render_buffer(cairo_t *cr, struct swappy_state *state) {
|
||||
|
||||
wl_list_for_each(output, &state->outputs, link) {
|
||||
struct swappy_buffer *buffer = output->buffer;
|
||||
|
||||
if (output->buffer == NULL) {
|
||||
g_warning(
|
||||
"screencopy buffer is empty, cannot draw it onto the paint area");
|
||||
continue;
|
||||
}
|
||||
|
||||
cairo_format_t format = get_cairo_format(buffer->format);
|
||||
|
||||
g_assert(format != CAIRO_FORMAT_INVALID);
|
||||
@ -258,6 +265,9 @@ void render_state(struct swappy_state *state) {
|
||||
|
||||
cairo_set_source_rgb(cr, 1, 1, 1);
|
||||
|
||||
cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
|
||||
cairo_paint(cr);
|
||||
|
||||
render_buffer(cr, state);
|
||||
render_paints(cr, state);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user