From 0126cee55d7a0980c47b76b57d97952c95ed0488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 25 Feb 2020 19:53:06 +0100 Subject: [PATCH] wayland: xdg_surface_configure(): call wl_surface_commit() It seems kwin expects a wl_surface_commit() for each xdg_surface_ack_configure(). We don't want to commit before we've rendered a resized surface. So, if we *did* change the window size, let the normal rendering path do the surface commit. Only when we did *not* change the window size do we need to explicitly commit the surface in xdg_surface_configure(). --- wayland.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wayland.c b/wayland.c index 292f711d..c40d0111 100644 --- a/wayland.c +++ b/wayland.c @@ -513,19 +513,28 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, uint32_t serial) { LOG_DBG("xdg-surface: configure"); - xdg_surface_ack_configure(xdg_surface, serial); struct wl_window *win = data; struct terminal *term = win->term; win->is_configured = true; - render_resize(term, win->configure.width, win->configure.height); + xdg_surface_ack_configure(xdg_surface, serial); + bool resized = render_resize(term, win->configure.width, win->configure.height); if (win->configure.is_activated) term_visual_focus_in(term); else term_visual_focus_out(term); + + if (!resized) { + /* + * kwin seems to need a commit for each configure ack, or it + * will get stuck. Since we'll get a "real" commit soon if we + * resized, only commit here if size did *not* change + */ + wl_surface_commit(win->surface); + } } static const struct xdg_surface_listener xdg_surface_listener = {