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); }