f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Cheatsheet scrolling does not work when no model is loaded on windows

Open 19jrushlow opened this issue 7 months ago • 12 comments

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

  1. Open f3d with no model selected on windows.
  2. Attempt to scroll the cheatsheet. It does not work.
  3. 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.

19jrushlow avatar May 23 '25 19:05 19jrushlow

Linux too, and indeed a regression

mwestphal avatar May 23 '25 19:05 mwestphal

maybe related to https://github.com/f3d-app/f3d/pull/2118 @exbluesbreaker

mwestphal avatar May 23 '25 19:05 mwestphal

I will have a look

exbluesbreaker avatar May 23 '25 19:05 exbluesbreaker

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.

exbluesbreaker avatar May 24 '25 09:05 exbluesbreaker

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.

exbluesbreaker avatar May 24 '25 09:05 exbluesbreaker

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

exbluesbreaker avatar May 24 '25 15:05 exbluesbreaker

Apparently, drag and drop is not prevented by this additional flag.

exbluesbreaker avatar May 24 '25 15:05 exbluesbreaker

Apparently, drag and drop is not prevented by this additional flag.

Thanks for checking on that, CI does not test it.

mwestphal avatar May 24 '25 18:05 mwestphal

ImGuiWindowFlags_NoMouseInputs looks like a correct approach

mwestphal avatar May 24 '25 18:05 mwestphal

I will finalize commit/tests tomorrow, was busy in the evening

exbluesbreaker avatar May 24 '25 19:05 exbluesbreaker

should I mark this as closed?

19jrushlow avatar Jun 02 '25 19:06 19jrushlow

I guess so. Maybe just confirm @mwestphal ?

exbluesbreaker avatar Jun 02 '25 19:06 exbluesbreaker

Indeed fixed! Thanks @exbluesbreaker !

mwestphal avatar Jun 18 '25 06:06 mwestphal