dtchat: repaint the UI after the local dialogs close

Xvfb without a window manager leaves the area under a closed SAS/offer dialog unpainted; localui.c clears and exposes the main shell after destroying the dialog. make mcde-host exit=0 after the change; the built UI + headless pairing/message run still passes.
This commit is contained in:
lotherk committed 2026-11-17 06:33:25 +00:00
1 parent 7025ae866e
commit f372fa0981
1 file changed
+17
+17
View File
@@ -82,6 +82,19 @@ status(DtLocal *local, const char *text)
dtchat_ui_set_status(local->ui, text);
}
/* A destroyed dialog leaves a hole under Xvfb (no window manager). */
static void
repaint_ui(DtLocal *local)
{
Widget shell = dtchat_ui_shell(local->ui);
if (shell != NULL && XtIsRealized(shell)) {
XClearArea(XtDisplay(shell), XtWindow(shell), 0, 0, 0, 0,
True);
XFlush(XtDisplay(shell));
}
}
static Peer *
peer_find_id(DtLocal *local, const char *id)
{
@@ -188,6 +201,7 @@ pair_accept(PairCtx *ctx)
}
status(ctx->local, "peer paired");
XtDestroyWidget(ctx->shell);
repaint_ui(ctx->local);
free(ctx);
}
@@ -212,6 +226,7 @@ pair_reject(PairCtx *ctx)
}
status(ctx->local, "peer blocked");
XtDestroyWidget(ctx->shell);
repaint_ui(ctx->local);
free(ctx);
}
@@ -343,6 +358,7 @@ offer_accept(OfferCtx *ctx)
status(ctx->local, "receiving file");
}
XtDestroyWidget(ctx->shell);
repaint_ui(ctx->local);
dc_json_free(ctx->offer);
free(ctx);
}
@@ -363,6 +379,7 @@ offer_reject(OfferCtx *ctx)
(void)dc_local_conn_send_json(ctx->peer->conn, rej);
dc_json_free(rej);
XtDestroyWidget(ctx->shell);
repaint_ui(ctx->local);
dc_json_free(ctx->offer);
free(ctx);
}