mirror of https://github.com/encounter/objdiff.git
Luke Street
74e89130a8
Previously, we repainted every frame on Windows at full refresh rate. This is an enormous waste, as the UI will be static most of the time. This was to work around a bug with `rfd` + `eframe`. On other platforms, we only repainted every frame when a job was running, which was better, but still not ideal. We also had a 100ms deadline, so we'd repaint at ~10fps minimum to catch new events (file watcher, jobs). This removes all repaint logic from the main loop and moves it into the individual places where we change state from another thread. For example, the file watcher thread will now immediately notify egui to repaint, rather than relying on the 100ms deadline we had previously. Jobs, when updating their status, also notify egui to repaint. For `rfd` file dialogs, this migrates to using the async API built on top of a polling thread + `pollster`. This interacts better with `eframe` on Windows. Overall, this should reduce repaints and improve responsiveness to file changes and background tasks. |
||
---|---|---|
.. | ||
diff | ||
jobs | ||
obj | ||
views | ||
app.rs | ||
app_config.rs | ||
config.rs | ||
lib.rs | ||
main.rs | ||
update.rs |