WINGs: dispatch WME_CONFIGURE synchronously before redisplay on resize

The configure event was enqueued for later processing but the redisplay
happened immediately, painting children at their old positions. Now
WMHandleEvent is called directly with the configure event so widget
delegates relayout children before the redisplay paints them.

Also removed scroller debug logging.
This commit is contained in:
Window Maker 2026-05-24 17:15:36 +02:00
parent 53b23a582c
commit b4dbf15817
2 changed files with 4 additions and 10 deletions

View File

@ -300,13 +300,12 @@ xdg_surface_handle_configure(void *data, struct xdg_surface *xs, uint32_t serial
if (nb) {
wlclient_destroy_shm_buffer(top->buf);
top->buf = nb;
/* Tell WINGs the backing pointer changed so subsequent
* draws hit the new buffer. */
W_SetViewBacking(top->view->window, nb->image);
top->view->size.width = top->pending_w;
top->view->size.height = top->pending_h;
/* Notify WINGs of the resize so widget delegates relayout */
/* Dispatch configure event synchronously so widget delegates
* relayout children before we repaint. */
WMEvent cev;
memset(&cev, 0, sizeof(cev));
cev.type = WME_CONFIGURE;
@ -315,7 +314,8 @@ xdg_surface_handle_configure(void *data, struct xdg_surface *xs, uint32_t serial
cev.u.configure.event = top->view->window;
cev.u.configure.width = top->pending_w;
cev.u.configure.height = top->pending_h;
W_WL_EnqueueEvent(top->ctx->scr, &cev, top->view);
cev._view_target = top->view;
WMHandleEvent(&cev);
/* Repaint all content into the new buffer */
if (top->view->flags.mapped) {

View File

@ -447,12 +447,6 @@ static void wl_redisplay(void *vctx, W_View *view)
W_View *next = child->nextSister;
if (child->flags.mapped && child->flags.realized && !child->flags.alreadyDead) {
wl_redisplay(vctx, child);
} else if (child->flags.realized && !child->flags.mapped) {
/* Debug: find unmapped children that should be mapped */
if (view->size.width >= 400 && view->size.height > 50 && view->size.height < 100)
wwarning("wl_redisplay: UNMAPPED child %p in view %p (%dx%d) child_size=%dx%d pos=%d,%d",
(void*)child, (void*)view, view->size.width, view->size.height,
child->size.width, child->size.height, child->pos.x, child->pos.y);
}
child = next;
}