diff --git a/WINGs/wclient_wl.c b/WINGs/wclient_wl.c index 565a63c..59a6d4b 100644 --- a/WINGs/wclient_wl.c +++ b/WINGs/wclient_wl.c @@ -584,6 +584,22 @@ W_WLClientBeginMove(WNativeWindow window) return True; } +/* ------------------------------------------------------------------ */ + +void +W_WLClientCommitAllToplevels(void) +{ + for (int i = 0; i < WLC_TOPTABLE_SIZE; i++) { + WLClientToplevel *top = wlc_toptable[i].top; + if (top && top->mapped && top->configured && top->buf && top->buf->wl_buf) { + wl_surface_attach(top->surface, top->buf->wl_buf, 0, 0); + wl_surface_damage_buffer(top->surface, 0, 0, + top->buf->width, top->buf->height); + wl_surface_commit(top->surface); + } + } +} + /* ------------------------------------------------------------------ */ /* Input: wl_pointer / wl_keyboard listeners */ /* ------------------------------------------------------------------ */ diff --git a/WINGs/wevent_wl.c b/WINGs/wevent_wl.c index 490a105..c4e5c18 100644 --- a/WINGs/wevent_wl.c +++ b/WINGs/wevent_wl.c @@ -157,11 +157,17 @@ wl_check_typed_window(void *ectx, WNativeWindow w, int type, WMEvent *ev) return False; } +extern void W_WLClientCommitAllToplevels(void); + static void wl_flush(void *ectx, Bool discard) { WLEventCtx *ctx = ectx; (void)discard; + /* Commit any toplevel surfaces that may have been painted into + * since the last flush (direct fill_rect, draw_line, etc. don't + * trigger individual commits). */ + W_WLClientCommitAllToplevels(); /* Pump the wlroots event loop so pointer/key events arrive in our queue. * This is called from waitForEvent/WMMaskEvent when the queue is empty. */ if (ctx->dispatch_fn)