From 996e10ed022f336732dbb11c5ff77095a11a3c97 Mon Sep 17 00:00:00 2001 From: DanS Date: Fri, 17 Jul 2026 22:35:02 -0500 Subject: [PATCH] fix(ui): stop forward-wheel double-scroll on peers & console tabs The inner scroll child (##PeersList / ConsoleOutput) uses NoScrollWithMouse + ApplySmoothScroll; ImGui forwards its wheel up to the outer scroll container, so the wheel scrolled both. Add NoScrollWithMouse to the outer containers (safe: both fill the remaining height and never overflow), matching the contacts/explorer fix. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/console_tab.cpp | 6 +++++- src/ui/windows/peers_tab.cpp | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui/windows/console_tab.cpp b/src/ui/windows/console_tab.cpp index 575512f..1e3ca75 100644 --- a/src/ui/windows/console_tab.cpp +++ b/src/ui/windows/console_tab.cpp @@ -311,8 +311,12 @@ void ConsoleTab::render(ConsoleCommandExecutor& exec) computeVisibleLines(has_text_filter_, filter_lower_); // Main console layout + // NoScrollWithMouse: the inner ConsoleOutput owns wheel scrolling (via ApplySmoothScroll). Without + // this, a wheel over the output would scroll BOTH the output (smooth-scroll) and this outer container + // (ImGui forwards the NoScrollWithMouse child's wheel to its scrollable ancestor) — a double-scroll. + // Safe because the output panel is sized to fill the remaining height, so this outer never overflows. ImGui::BeginChild("ConsoleContainer", ImVec2(0, 0), false, - ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar); + ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse); // Optional status header (lite: sync + last error) above the toolbar. renderStatusHeader(exec); diff --git a/src/ui/windows/peers_tab.cpp b/src/ui/windows/peers_tab.cpp index 6d0c5c3..c823a74 100644 --- a/src/ui/windows/peers_tab.cpp +++ b/src/ui/windows/peers_tab.cpp @@ -98,7 +98,12 @@ void RenderPeersTab(App* app) // Scrollable child to contain all content within available space ImVec2 peersAvail = ImGui::GetContentRegionAvail(); - ImGui::BeginChild("##PeersScroll", peersAvail, false, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar); + // NoScrollWithMouse: the inner ##PeersList owns wheel scrolling (via ApplySmoothScroll). Without + // this, a wheel over the list would scroll BOTH the list (smooth-scroll) and this outer container + // (ImGui forwards the NoScrollWithMouse child's wheel to its scrollable ancestor) — a double-scroll. + // Safe because the peer panel is sized to fill the remaining height, so this outer never overflows. + ImGui::BeginChild("##PeersScroll", peersAvail, false, + ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse); // Responsive: scale factors per frame float availWidth = ImGui::GetContentRegionAvail().x;