Cheatsheet scrolling does not work when no model is loaded on windows
Describe the bug
The cheatsheet does not scroll when no model is loaded on Windows. Neither the scrollbar nor the mouse wheel work. Upon loading a model, it resumes working.
To Reproduce
- Open f3d with no model selected on windows.
- Attempt to scroll the cheatsheet. It does not work.
- Load any model. The cheatsheet will now scroll properly.
Expected behavior
The cheatsheet should scroll properly even if no model is loaded.
System Information:
OS: Windows
F3D Information
Bug happens when built from master on Windows. It does not happen on 3.1.0 or prior.
Linux too, and indeed a regression
maybe related to https://github.com/f3d-app/f3d/pull/2118 @exbluesbreaker
I will have a look
It is definitely related usage of ImGuiWindowFlags_NoBringToFrontOnFocus flag which was added to solve the linked issue. If flag is not applied for cheat sheet it can be scrolled normally.
But root cause is not yet clear to me, as it happens only when drop zone is visible. Without drop zone, if another imgui window like meta data or console is drawn it doesn't make cheatsheet unscrollable.
Will keep working on it.
Also, if flag is applied to console window, it also became unscrollable with dropzone, and if both console and cheatsheet (with this flag) are shown with dropzone they both are unscrollable.
I found a way to prevent observed issue by analyzing a bit more ImGui internals of processing.
Basically Drop Zone with ImGuiWindowFlags_NoBringToFrontOnFocus logic for other windows (even if itself have it) is always in front in "hovering" logic due just the order of ImGui commands, it causes always become "the best target" in "hovering" which eventually triggers scrolling, but drop zone itself doesn't have suitable scrolling setup and scrolling for it is essentially NOP.
I found it possible to prevent by adding ImGuiWindowFlags_NoMouseInputs (for Drop Zone). I will prepare pull request and relevant tests.
UPDATE: Hm, actually I realized it is probably not wanted as it will prevent drag and drop for drop zone. Will look into it
Apparently, drag and drop is not prevented by this additional flag.
Apparently, drag and drop is not prevented by this additional flag.
Thanks for checking on that, CI does not test it.
ImGuiWindowFlags_NoMouseInputs looks like a correct approach
I will finalize commit/tests tomorrow, was busy in the evening
should I mark this as closed?
I guess so. Maybe just confirm @mwestphal ?
Indeed fixed! Thanks @exbluesbreaker !