Fix buffer size not divisible by scale
This commit is contained in:
parent
5db5b3a7c7
commit
5ed249e3f3
1 changed files with 1 additions and 2 deletions
3
main.c
3
main.c
|
@ -394,6 +394,7 @@ void render_frame(struct menu_state *state) {
|
||||||
cairo_set_source_surface(shm, recorder, 0, 0);
|
cairo_set_source_surface(shm, recorder, 0, 0);
|
||||||
cairo_paint(shm);
|
cairo_paint(shm);
|
||||||
|
|
||||||
|
wl_surface_set_buffer_scale(state->surface, scale);
|
||||||
wl_surface_attach(state->surface, state->current->buffer, 0, 0);
|
wl_surface_attach(state->surface, state->current->buffer, 0, 0);
|
||||||
wl_surface_damage(state->surface, 0, 0, state->width, state->height);
|
wl_surface_damage(state->surface, 0, 0, state->width, state->height);
|
||||||
wl_surface_commit(state->surface);
|
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 wl_output *wl_output) {
|
||||||
struct menu_state *state = data;
|
struct menu_state *state = data;
|
||||||
state->output = wl_output_get_user_data(wl_output);
|
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);
|
render_frame(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue