Flix01 / imgui

Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home
MIT License
396 stars 34 forks source link

Don't move window when dragging a split. #29

Closed tom-seddon closed 6 years ago

tom-seddon commented 6 years ago

Don't move window when dragging a split. You can see this bug in the main.html HTML demo: click the ImGui Dock button, then drag the horizontal splitter vertically in the resulting window. I couldn't get the demo code building in Windows, but this fix did fix it in my test code...

(Because the splitter ends up behind everything else, the hovered ID needs to be updated manually. The splitter's invisible button's call to ImGui::ItemHoverable ends up bailing out early from the g.HoveredWindow != g.CurrentWindow check, so the hovered ID is never updated there. If there's no hovered ID by the time of ImGui::EndFrame, there appears to be no widget under the cursor, and dragging the mouse may then move the window.)

Flix01 commented 6 years ago

Thanks a bunch :+1:

I wonder why I didn't spot this BIG issue before...

I've just tested the fix and it seems to work (will update main.html soon: updated).

As far as the Windows build is concerned, I'd like to make it work out of the box, but I'm on Linux, so without any feedback, I can't do much...