Hourglass when loading apps.

This commit is contained in:
Scott Duensing 2026-03-26 18:38:56 -05:00
parent 97503080a5
commit 09da5f3857

View file

@ -343,12 +343,16 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
// Snapshot free memory before loading so we can estimate app usage
dvxMemSnapshotLoad(id);
// Show hourglass during the load (dlopen + symbol resolution + appMain)
dvxSetBusy(ctx, true);
// Load the DXE
void *handle = dlopen(loadPath, RTLD_GLOBAL);
if (!handle) {
char msg[512];
snprintf(msg, sizeof(msg), "Failed to load %s:\n%s", baseName(path), dlerror());
dvxSetBusy(ctx, false);
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
if (tempPath[0]) {
@ -364,6 +368,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
if (!desc) {
char msg[256];
snprintf(msg, sizeof(msg), "%s: missing appDescriptor", baseName(path));
dvxSetBusy(ctx, false);
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
dlclose(handle);
@ -379,6 +384,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
if (!entry) {
char msg[256];
snprintf(msg, sizeof(msg), "%s: missing appMain", baseName(path));
dvxSetBusy(ctx, false);
dvxMessageBox(ctx, "Error", msg, MB_OK | MB_ICONERROR);
dlclose(handle);
@ -464,6 +470,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
if (taskId < 0) {
ctx->currentAppId = 0;
dvxSetBusy(ctx, false);
dvxMessageBox(ctx, "Error", "Failed to create task for application.", MB_OK | MB_ICONERROR);
dlclose(handle);
free(app->dxeCtx);
@ -485,6 +492,7 @@ int32_t shellLoadApp(AppContextT *ctx, const char *path) {
app->state = AppStateRunningE;
dvxLog("Shell: loaded '%s' (id=%ld, mainLoop=%s, entry=0x%08lx, desc=0x%08lx)", app->name, (long)id, app->hasMainLoop ? "yes" : "no", (unsigned long)entry, (unsigned long)desc);
dvxSetBusy(ctx, false);
shellDesktopUpdate();
return id;
}