Skip to content

Commit

Permalink
Docking: Fixed dragging from title-bar empty space (#5181, #2645)
Browse files Browse the repository at this point in the history
This would need a test in ImGuiTestSuite.
  • Loading branch information
ocornut committed Jun 12, 2023
1 parent 0664877 commit 3f63cee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
25 changes: 15 additions & 10 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ HOW TO UPDATE?
and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users.
- Please report any issue!

-----------------------------------------------------------------------
VERSION 1.89.7 WIP (In Progress)
-----------------------------------------------------------------------

Other changes:

- Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either
ScrollX or ScrollY flags from being impossible to resize. (#6503)


-----------------------------------------------------------------------
DOCKING+MULTI-VIEWPORT BRANCH (In Progress)
-----------------------------------------------------------------------
Expand Down Expand Up @@ -107,6 +97,21 @@ Other changes:
Note that Linux/Mac still have inconsistent support for multi-viewports. If you want to help see https://github.com/ocornut/imgui/issues/2117.


-----------------------------------------------------------------------
VERSION 1.89.7 WIP (In Progress)
-----------------------------------------------------------------------

Other changes:

- Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either
ScrollX or ScrollY flags from being impossible to resize. (#6503)

Docking+Viewports Branch:

- Docking: Fixed dragging from title-bar empty space (regression from 1.88 related to
keeping ID alive when calling low-level ButtonBehavior() directly). (#5181, #2645)


-----------------------------------------------------------------------
VERSION 1.89.6 (Released 2023-05-31)
-----------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16740,11 +16740,12 @@ static void ImGui::DockNodeUpdateTabBar(ImGuiDockNode* node, ImGuiWindow* host_w
}

// When clicking on the title bar outside of tabs, we still focus the selected tab for that node
// FIXME: TabItem use AllowItemOverlap so we manually perform a more specific test for now (hovered || held)
// FIXME: TabItems submitted earlier use AllowItemOverlap so we manually perform a more specific test for now (hovered || held) in order to not cover them.
ImGuiID title_bar_id = host_window->GetID("#TITLEBAR");
if (g.HoveredId == 0 || g.HoveredId == title_bar_id || g.ActiveId == title_bar_id)
{
bool held;
KeepAliveID(title_bar_id);
ButtonBehavior(title_bar_rect, title_bar_id, NULL, &held, ImGuiButtonFlags_AllowItemOverlap);
if (g.HoveredId == title_bar_id)
{
Expand Down

0 comments on commit 3f63cee

Please sign in to comment.