From 1817ef3df12a1c03d8642291eb7facd42c0f5580 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 18 Jan 2023 10:58:55 +0000 Subject: [PATCH] wl_window: fix buffer size not divisible by scale Do not commit the surface with the new scale and the old buffer. Leave it to the next rendering pass to commit the surface. Fixes the following protocol error: wl_surface@10: error 2: Buffer size (717x795) is not divisible by scale (2) Closes: https://todo.sr.ht/~exec64/imv/20 --- src/wl_window.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index 5efa42f..0c2221a 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -550,8 +550,6 @@ static void update_scale(struct imv_window *window) if (new_scale != window->scale) { window->scale = new_scale; wl_surface_set_buffer_scale(window->wl_surface, window->scale); - wl_surface_commit(window->wl_surface); - wl_display_roundtrip(window->wl_display); size_t buffer_width = window->width * window->scale; size_t buffer_height = window->height * window->scale; wl_egl_window_resize(window->egl_window, buffer_width, buffer_height, 0, 0);