Skip to content

Commit 2a9f36b

Browse files
authored
Merge pull request #72 from houssemko/pulse-tick
Pulse indeterminate bars on wall-clock, not progress ticks
2 parents e5a48cb + 1fccd12 commit 2a9f36b

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎src/window.rs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,28 @@ fn build_row(
490490
another_queued(manager, item),
491491
manager.is_live_video(item.id()),
492492
);
493+
// Indeterminate activity runs on wall-clock, not progress ticks.
494+
// Resolving ("Resolving media…") emits no property changes, so a
495+
// pulse driven by refresh_row alone freezes on one frame — the
496+
// reported hang. This tick advances only indeterminate bars
497+
// (active with no fraction, or live) and dies with the row; real
498+
// fractions keep rendering from progress notifies as before.
499+
{
500+
let bar = progress.downgrade();
501+
let weak_item = item.downgrade();
502+
let m = Rc::clone(manager);
503+
glib::timeout_add_local(std::time::Duration::from_millis(120), move || {
504+
let (Some(bar), Some(it)) = (bar.upgrade(), weak_item.upgrade()) else {
505+
return glib::ControlFlow::Break;
506+
};
507+
if it.status() == DownloadStatus::Downloading
508+
&& (m.is_live_video(it.id()) || it.progress() <= 0.0)
509+
{
510+
bar.pulse();
511+
}
512+
glib::ControlFlow::Continue
513+
});
514+
}
493515

494516
{
495517
let m = Rc::clone(manager);

0 commit comments

Comments
 (0)