bug: opening a picture freezes the window — no progress, no way to stop it #10
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
linux
packaging
performance
question
tech-debt
ui
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ben/openDither#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: 0.1.2 (
main@41c7fc5)System: Linux, X11 (XWayland) and Windows 11 — reported by the person using it as "Programm antwortet nicht" when opening files.
Steps to reproduce
What should have happened
The window keeps answering: the picture appears with a progress hint, and a slow operation can be cancelled.
What happened instead
Reading, decoding and dithering all happen inside the UI callback, before the window draws anything, so the desktop marks the app as not responding and clicks are queued until it is done.
fn set_source(main.rs:834) is the whole pipeline, synchronously:It is called straight from the menu, from the drop handler in
ui(), and from the batch export. For 24 MP: 1.43 s and 836 MB peak RSS before the first frame is drawn; with Neo Glow on 12 MP it is 66 s.fn load_projecthas the same shape (read the zip, decode everymedia/entry, render).Nothing in the app can interrupt a render: there is no worker, no progress and no cancel.
busy_sinceonly debounces re-renders by 40 ms.Suggested fix
Move the slow half off the UI thread and keep the last frame on screen:
ui()drains once per frame.Esc/a Stop button for a render in flight; a cancelled job drops its result on arrival.This is the same fix for opening a picture, opening a project and the Neo Glow render, so it is worth doing once rather than per caller.
A check that would catch it
An
--auditrow that starts a job for a 12 MP picture and asserts the UI loop keeps producing frames (with a frame counter, not with a wall-clock threshold), plus one that a job superseded by a newer generation is discarded.