From f372fa0981c265183ea751d9e7e3a44a509d7940 Mon Sep 17 00:00:00 2001 From: lotherk Date: Tue, 17 Nov 2026 06:33:25 +0000 Subject: [PATCH] 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. --- programs/dtchat/localui.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/programs/dtchat/localui.c b/programs/dtchat/localui.c index 5ebbd809..23f96bf3 100644 --- a/programs/dtchat/localui.c +++ b/programs/dtchat/localui.c @@ -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); }