xwayland: Commit after acknowledging configure

When handling libdecor configure, we first update our xwl output and
screen if dimensions differ from the current xwl_screen, and then commit
a new libdecor frame which acknowledges the xdg_surface.configure event.

If the initial configure events contains non-zero dimensions, we will
update the xwl output before acknowledging the initial configure. As we
attach a buffer and commit the surface when updating the output, this
leads to a protocol error.

Instead, move the surface commit till the end of the configure handler
so it always happens after the ack.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
This commit is contained in:
Kenny Levinsen 2023-08-10 13:31:17 +02:00
parent 34446a9952
commit 295fb71653

View File

@ -647,7 +647,6 @@ xwl_window_libdecor_resize(struct xwl_window *xwl_window, int width, int height)
xwl_output_set_mode_fixed(xwl_output, mode);
xwl_window_attach_buffer(xwl_window);
wl_surface_commit(xwl_window->surface);
}
static void
@ -672,6 +671,7 @@ handle_libdecor_configure(struct libdecor_frame *frame,
xwl_window_update_libdecor_size(xwl_window, configuration,
xwl_screen->width, xwl_screen->height);
wl_surface_commit(xwl_window->surface);
}
static void