Only cache capsule geometry after a successful relayout
The capsule geometry cache must reflect only applied layout, otherwise a transient resize or position failure would permanently suppress future retries for the same monitor and translation state. The cache is now written only after the relayout call succeeds, so a failed attempt can be retried on later emits. Constraint: Keep the fix local to the capsule relayout path. Rejected: Cache before calling relayout | can strand the capsule on stale geometry after a transient failure. Confidence: high Scope-risk: narrow Directive: Never treat capsule geometry as applied until the window manager has accepted the resize/reposition. Tested: cargo test --manifest-path src-tauri/Cargo.toml --lib -- --nocapture Not-tested: Live retry behavior under actual window-manager failures.
This commit is contained in:
1 parent
1dfcf7f302
commit
e8ba67a45f
1 file changed
+9
-5
@@ -2502,13 +2502,17 @@ fn maybe_position_capsule_bottom_center<R: tauri::Runtime>(
|
||||
monitor_height: monitor.size().height,
|
||||
scale_bits: monitor.scale_factor().to_bits(),
|
||||
};
|
||||
let mut last = inner.capsule_layout.lock();
|
||||
if last.as_ref() == Some(&next) {
|
||||
{
|
||||
let last = inner.capsule_layout.lock();
|
||||
if last.as_ref() == Some(&next) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if crate::position_capsule_bottom_center(window, translation_active).is_ok() {
|
||||
let mut last = inner.capsule_layout.lock();
|
||||
*last = Some(next);
|
||||
return;
|
||||
}
|
||||
*last = Some(next);
|
||||
drop(last);
|
||||
let _ = crate::position_capsule_bottom_center(window, translation_active);
|
||||
}
|
||||
|
||||
// ─────────────────────────── audio bridge ───────────────────────────
|
||||
|
||||
Reference in new issue
Block a user