backend/wayland: use request_state when toplevel is resized

This commit is contained in:
Simon Ser 2021-01-28 16:04:47 +01:00
parent 666e92f15e
commit 5d8dd29d99
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -550,8 +550,17 @@ static void xdg_toplevel_handle_configure(void *data,
if (width == 0 || height == 0) {
return;
}
// loop over states for maximized etc?
output_set_custom_mode(&output->wlr_output, width, height, 0);
if (width == output->wlr_output.width &&
height == output->wlr_output.height) {
return;
}
struct wlr_output_state state = {
.committed = WLR_OUTPUT_STATE_MODE,
.mode_type = WLR_OUTPUT_STATE_MODE_CUSTOM,
.custom_mode = { .width = width, .height = height },
};
wlr_output_send_request_state(&output->wlr_output, &state);
}
static void xdg_toplevel_handle_close(void *data,