Mouse scrolling not working
Version/Branch of Dear ImGui:
Version 1.90.5, Branch: master (master/docking/etc.), no modifications
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_sdl2.cpp
Compiler, OS:
Windows 10 + MSVC2022
Full config/build information:
No response
Details:
My Issue/Question: I'm not quite sure when this started, since I never really have this situation much, but I recently noticed that any kind of scrolling (e.g. of list-boxes) with the mouse wheel is not working for me. This is also the case for the demo window. I checked with the debugger, that the mousewheel event is emitted correctly (?, with wheel_y != 0). I'm pretty sure this was working at some point. I have recently updated dearImGui but can't be sure if that broke it or if it was already broken before. Any help would be greatly appreciated. Same problem also happens with clang.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
// Here's some code anyone can copy and paste to reproduce your issue
ImGui::Begin("Example Bug");
MoreCodeToExplainMyIssue();
ImGui::End();
You will need to provide more details. First try in to see if it happens official unmodified examples.
I compiled the unmodified opengl3/sdl2 example. The behaviour is slightly different but still not working as expected. Here is a video of what it looks like: https://www.youtube.com/watch?v=dFMub49vs2g
The scrolling down produces some flickering as if it always resets to the top on the next frame. Scrolling up instead directly jumps to the top. I don't know if this information helps or what else I can/should provide.
@Thalenberghen since you use SDL2 backend, you can try to add printf(stdout, "wheel x=%f, y=%f\n", wheel_x, wheel_y); fflush(stdout); to see what wheel x/y offsets passed into Dear ImGui. Put it before io.AddMouseWheelEvent(wheel_x, wheel_y) in imgui_impl_sdl2.cpp here:
https://github.com/ocornut/imgui/blob/4bb75671414f532fc11e85e06e0ab972e42a8907/backends/imgui_impl_sdl2.cpp#L321-L337
I have added the line, and interestingly it behaves like my program now, where nothing happens at all. All the values it prints for wheel x and y are 0 or -0.
Edit: I checked and the value for the event->wheel_y is showing +-1 as I would expect. But the precise_y which it seems to pick up is 0 or a gigantic negative number.
Use Demo>Debug Log>IO to visualize data received by dear imgui.
So what's the verdict? If I uncomment the preciseX/Y stuff and use the standard one everything works. Should I just do that?