Skip to content

Commit

Permalink
Popup: clicking on empty space also close popup #126
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Mar 26, 2015
1 parent ac2da57 commit 5fe4ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3309,7 +3309,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
if (window->Flags & ImGuiWindowFlags_Popup)
{
if (g.FocusedWindow != window)
if ((g.IO.MouseClicked[0] && (!g.HoveredWindow || g.HoveredWindow->RootWindow != window)) || (!g.FocusedWindow || g.FocusedWindow->RootWindow != window))
if (p_opened)
*p_opened = false;
}
Expand Down

0 comments on commit 5fe4ae6

Please sign in to comment.