ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
61.46k stars 10.34k forks source link

Lack of separate ImGuiDockNodeFlags_NoDockingSplitMe flag in 1.91 #8000

Open DDeimos opened 2 months ago

DDeimos commented 2 months ago

Version/Branch of Dear ImGui:

Version 1.91.1, Branch: docking

Back-ends:

any

Compiler, OS:

Windows 11 + MSVS 2022

Full config/build information:

No response

Details:

I updated from version 1.89 to 1.91. There were 2 different flags previously: ImGuiDockNodeFlagsPrivate_::ImGuiDockNodeFlags_NoDockingSplitMe and ImGuiDockNodeFlags_::ImGuiDockNodeFlags_NoSplit. Then there were 2 ways to set IsCenterAvailable=false in the ImGui::DockNodePreviewDockSetup function: either to set ImGuiDockNodeFlags_NoDocking or specifically ImGuiDockNodeFlags_NoDockingSplitMe. There is no such option now in 1.91. You have just ImGuiDockNodeFlags_NoDockingSplit flag and if you use it, you will disable all docking hints. Is it possible to get old behavior when I was able to disable side docking for current window only? Btw, it still works as expected for center docking with ImGuiDockNodeFlags_NoDockingOverMe flag.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

My previous setup:

  ImGui::GetWindowDockNode()->SetLocalFlags(
      ImGuiDockNodeFlags_CentralNode |
      ImGuiDockNodeFlags_NoDockingOverMe |
      ImGuiDockNodeFlags_NoDockingSplitMe |
      ImGuiDockNodeFlags_NoTabBar
    );

I can't just change ImGuiDockNodeFlags_NoDockingSplitMe to ImGuiDockNodeFlags_NoDockingSplit. It disables all hints as I've said. And I can't just remove the flag. In this case I get side hints for the current docking window.

ocornut commented 2 months ago

(Issue 8000 🎉😅)

I believe ImGuiDockNodeFlags_NoDockingSplit does exactly the same thing as ImGuiDockNodeFlags_NoDockingSplitMe so I don't understand your statement. Can you clarify what you mean by:

I can't just change ImGuiDockNodeFlags_NoDockingSplitMe to ImGuiDockNodeFlags_NoDockingSplit. It disables all hints as I've said. And I can't just remove the flag. In this case I get side hints for the current docking window.

DDeimos commented 2 months ago

Great to be 8000! The problem is caused by this condition in my opinion: if ((host_node && (host_node->MergedFlags & ImGuiDockNodeFlags_NoDockingSplit)) || g.IO.ConfigDockingNoSplit) from the ImGui::DockNodePreviewDockRender. Previously, you had to set at least ImGuiDockNodeFlags_NoSplit flag to make it true. And I didn't set it in my case, I had ImGuiDockNodeFlags_NoDockingSplitMe only. So, now if I set ImGuiDockNodeFlags_NoDockingSplit to make IsSidesAvailable=false I automatically make this condition true. As a result, the condition breaks the loop, and we skip drop boxes display.

DDeimos commented 1 month ago

Hi, are there any updates on the issue?