From 5d8dd29d991650eecb07d0ee62fb65469b3919f4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 28 Jan 2021 16:04:47 +0100 Subject: [PATCH] backend/wayland: use request_state when toplevel is resized --- backend/wayland/output.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/wayland/output.c b/backend/wayland/output.c index e9353aa38..5a117972c 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -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,