From 15019ef542012dd0a43ff1c39f4275b6a8810594 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Thu, 26 Mar 2026 21:25:04 -0500 Subject: [PATCH] Hourglass now displayed when saving images. --- core/dvxApp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/dvxApp.c b/core/dvxApp.c index b310cbf..93047c2 100644 --- a/core/dvxApp.c +++ b/core/dvxApp.c @@ -1954,7 +1954,9 @@ static void interactiveScreenshot(AppContextT *ctx) { memcpy(scrBuf, ctx->display.backBuf, scrSize); if (dvxFileDialog(ctx, "Save Screenshot", FD_SAVE, NULL, filters, 2, path, sizeof(path))) { + dvxSetBusy(ctx, true); dvxSaveImage(ctx, scrBuf, scrW, scrH, scrPitch, path); + dvxSetBusy(ctx, false); } free(scrBuf); @@ -1987,7 +1989,9 @@ static void interactiveWindowScreenshot(AppContextT *ctx, WindowT *win) { memcpy(capBuf, win->contentBuf, capSize); if (dvxFileDialog(ctx, "Save Window Screenshot", FD_SAVE, NULL, filters, 2, path, sizeof(path))) { + dvxSetBusy(ctx, true); dvxSaveImage(ctx, capBuf, capW, capH, capPitch, path); + dvxSetBusy(ctx, false); } free(capBuf); @@ -4434,16 +4438,20 @@ bool dvxSaveTheme(const AppContextT *ctx, const char *filename) { // we only write to the LFB, never read. int32_t dvxScreenshot(AppContextT *ctx, const char *path) { + dvxSetBusy(ctx, true); + DisplayT *d = &ctx->display; uint8_t *rgb = bufferToRgb(d, d->backBuf, d->width, d->height, d->pitch); if (!rgb) { + dvxSetBusy(ctx, false); return -1; } int32_t result = stbi_write_png(path, d->width, d->height, RGB_CHANNELS, rgb, d->width * RGB_CHANNELS) ? 0 : -1; free(rgb); + dvxSetBusy(ctx, false); return result; } @@ -4875,15 +4883,19 @@ int32_t dvxWindowScreenshot(AppContextT *ctx, WindowT *win, const char *path) { return -1; } + dvxSetBusy(ctx, true); + uint8_t *rgb = bufferToRgb(&ctx->display, win->contentBuf, win->contentW, win->contentH, win->contentPitch); if (!rgb) { + dvxSetBusy(ctx, false); return -1; } int32_t result = stbi_write_png(path, win->contentW, win->contentH, RGB_CHANNELS, rgb, win->contentW * RGB_CHANNELS) ? 0 : -1; free(rgb); + dvxSetBusy(ctx, false); return result; }