diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-02-25 18:53:06 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-02-25 18:53:06 +0000 |
| commit | 0126cee55d7a0980c47b76b57d97952c95ed0488 (patch) | |
| tree | 300fac1f60ecc1a57b180507fca8c583a64841cc | |
| parent | render: render_resize_*() returns a boolean indicating whether size changed. (diff) | |
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().
| -rw-r--r-- | wayland.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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 = { |
