diff --git a/src/app_sweep.cpp b/src/app_sweep.cpp index 1fdbf24..052f560 100644 --- a/src/app_sweep.cpp +++ b/src/app_sweep.cpp @@ -22,6 +22,9 @@ #include "util/platform.h" #include "wallet/wallet_capabilities.h" +#include "imgui.h" +#include "imgui_internal.h" // ClosePopupToLevel / OpenPopupStack — flush stuck popups after teardown + #include #include @@ -465,6 +468,15 @@ void App::onScreenshotCaptured() { const SweepTarget& t = sweep_targets_[sweep_target_idx_]; if (t.teardown) t.teardown(*this); } + // Some surfaces leave an ImGui popup open (e.g. the send-confirm dialog calls OpenPopup but is + // torn down by just clearing its flag). The headless sweep never clicks, so ImGui's normal + // click-to-dismiss cleanup never runs and the popup lingers on the stack — which keeps + // IsPopupOpen(AnyPopup) true forever and disables the smooth-scroll wheel capture on + // Settings/Explorer/Console (draw_helpers::ApplySmoothScroll). Flush any lingering popup here so + // it can't bleed into the next surface's capture or survive past the sweep. + if (ImGuiContext* g = ImGui::GetCurrentContext(); g && g->OpenPopupStack.Size > 0) + ImGui::ClosePopupToLevel(0, false); + if (++sweep_target_idx_ >= static_cast(sweep_targets_.size())) { sweep_target_idx_ = 0; if (++sweep_skin_idx_ >= static_cast(sweep_skins_.size())) {