feat: add threading to Scheduler, fix desktop background selection freeze issue

This commit is contained in:
2026-05-23 16:08:25 +02:00
parent 28aadd3195
commit 159fea1667
15 changed files with 895 additions and 117 deletions
@@ -163,8 +163,16 @@ bool settings_handle_appearance_click(Window* win, SettingsState* st, int mx, in
montauk::strcpy(fullpath, st->desktop->home_dir);
str_append(fullpath, "/", 256);
str_append(fullpath, st->wp_files.names[i], 256);
wallpaper_load(&s, fullpath,
st->desktop->screen_w, st->desktop->screen_h);
// Decode and scale off the UI thread so rapid cycling
// between high-res images stays responsive. The radio state
// and persisted path update immediately; the pixel buffer
// arrives asynchronously and is swapped in by
// wallpaper_poll() on the next frame.
s.bg_image = true;
s.bg_gradient = false;
montauk::strncpy(s.bg_image_path, fullpath, 127);
wallpaper_load_async(fullpath,
st->desktop->screen_w, st->desktop->screen_h);
desktop_mark_background_dirty(st->desktop);
settings_persist(st);
return true;