aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradnano <me@adnano.co>2023-02-01 09:37:02 -0500
committeradnano <me@adnano.co>2023-02-01 09:37:02 -0500
commit5ed249e3f3505cdf8e1f50f6a3ad4f10d4746600 (patch)
treee140e4d240011d49dfc75f97835b8acc8aecd8c4
parent5db5b3a7c7a342815226ad4262368577539e3df9 (diff)
downloadwmenu-5ed249e3f3505cdf8e1f50f6a3ad4f10d4746600.tar.gz
Fix buffer size not divisible by scale
-rw-r--r--main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main.c b/main.c
index 31fed7e..8688f05 100644
--- a/main.c
+++ b/main.c
@@ -394,6 +394,7 @@ void render_frame(struct menu_state *state) {
cairo_set_source_surface(shm, recorder, 0, 0);
cairo_paint(shm);
+ wl_surface_set_buffer_scale(state->surface, scale);
wl_surface_attach(state->surface, state->current->buffer, 0, 0);
wl_surface_damage(state->surface, 0, 0, state->width, state->height);
wl_surface_commit(state->surface);
@@ -410,8 +411,6 @@ static void surface_enter(void *data, struct wl_surface *surface,
struct wl_output *wl_output) {
struct menu_state *state = data;
state->output = wl_output_get_user_data(wl_output);
- wl_surface_set_buffer_scale(state->surface, state->output->scale);
- wl_surface_commit(state->surface);
render_frame(state);
}