← Commit history

1.0.39: 1.0.39: REVERTS the 1.0.38 change. 1.0.38 retried a refused push to the background; on a slow VM the same KiCad window was then pushed repeatedly within seconds, and each push also forces the user's previous window to the front. With the taskbar as that window, Explorer was hammered and restarted while John was clicking KiCad's taskbar buttons. 1.0.39 is 1.0.37 plus this revert: one push per window, landed or not. Do not promote 1.0.38. The foreground design is wiki #112.

John Lauer ·2feb71b4bd ·1mo ago ·parent ce387b2
1 file changed +7−10
rust/crates/kicad-platform/src/win/etiquette.rs+7−10
@@ -658,16 +658,13 @@ fn handle_foreground(h: u64, source: Source, cache: &mut ExeCache) {             let result = match focus::push_to_background(hwnd(h)) {                 Ok(()) => "pushed",                 Err(e) => {-                    // The once-per-window slot was claimed above, before the push. A REFUSED push moved-                    // nothing (the window is busy loading and does not answer, the usual case on a slow-                    // box), so keeping the slot meant the window was never pushed at all and KiCad stayed-                    // in front for good (winvm, open_board, twice). Give the slot back: the sentinel-                    // tries again in 120 ms and the first push that LANDS is the one that counts. No-                    // strobe is possible, because a refusal draws no frame.-                    let mut g = lock();-                    g.last_error = e;-                    g.backgrounded_once.remove(&(h, pid));-                    g.bounces = g.bounces.saturating_sub(1);+                    // 1.0.38 gave the once-per-window slot back here so a refused push would be retried.+                    // REVERTED in 1.0.39: on winvm the same window was then pushed again and again within+                    // seconds, and every push also forces the user's previous window to the front. When+                    // that window was the taskbar John had just clicked, Explorer was hammered and died.+                    // One push per window, landed or not, until the retry can be done without touching+                    // the user's window (wiki #112).+                    lock().last_error = e;                     "push refused (window hung)"                 }             };