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().
This commit is contained in:
Daniel Eklöf 2020-02-25 19:53:06 +01:00
parent 595b32ddf9
commit 0126cee55d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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 = {