From a27933f6b56c8152066a1c16393031e3868c1017 Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Thu, 15 Oct 2026 15:29:03 +0200 Subject: [PATCH] Scrolling: when scrolling a window with the mouse wheel, own the wheel when its lock starts --- imgui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 3705e7262..94941ae9a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10698,6 +10698,7 @@ void ImGui::UpdateMouseWheel() if (do_scroll[ImGuiAxis_X]) { LockWheelingWindow(window, wheel.x); + SetKeyOwner(ImGuiKey_MouseWheelX, window->ID); float max_step = window->InnerRect.GetWidth() * 0.67f; float scroll_step = ImTrunc(ImMin(2 * window->FontRefSize, max_step)); SetScrollX(window, window->Scroll.x - wheel.x * scroll_step); @@ -10706,6 +10707,7 @@ void ImGui::UpdateMouseWheel() if (do_scroll[ImGuiAxis_Y]) { LockWheelingWindow(window, wheel.y); + SetKeyOwner(ImGuiKey_MouseWheelY, window->ID); float max_step = window->InnerRect.GetHeight() * 0.67f; float scroll_step = ImTrunc(ImMin(5 * window->FontRefSize, max_step)); SetScrollY(window, window->Scroll.y - wheel.y * scroll_step);