@@ -5748,7 +5748,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
5748
5748
if (window_just_activated_by_user)
5749
5749
{
5750
5750
window->AutoPosLastDirection = ImGuiDir_None;
5751
- if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api)
5751
+ if ((flags & ImGuiWindowFlags_Popup) != 0 && !(flags & ImGuiWindowFlags_Modal) && ! window_pos_set_by_api) // FIXME: BeginPopup() could use SetNextWindowPos( )
5752
5752
window->Pos = g.BeginPopupStack.back().OpenPopupPos;
5753
5753
}
5754
5754
@@ -7807,6 +7807,7 @@ void ImGui::CloseCurrentPopup()
7807
7807
window->DC.NavHideHighlightOneFrame = true;
7808
7808
}
7809
7809
7810
+ // Attention! BeginPopup() adds default flags which BeginPopupEx()!
7810
7811
bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
7811
7812
{
7812
7813
ImGuiContext& g = *GImGui;
@@ -7855,12 +7856,13 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla
7855
7856
return false;
7856
7857
}
7857
7858
7858
- // Center modal windows by default
7859
+ // Center modal windows by default for increased visibility
7860
+ // (this won't really last as settings will kick in, and is mostly for backward compatibility. user may do the same themselves)
7859
7861
// FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window.
7860
7862
if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0)
7861
- SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Appearing , ImVec2(0.5f, 0.5f));
7863
+ SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_FirstUseEver , ImVec2(0.5f, 0.5f));
7862
7864
7863
- flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings ;
7865
+ flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse;
7864
7866
const bool is_open = Begin(name, p_open, flags);
7865
7867
if (!is_open || (p_open && !*p_open)) // NB: is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
7866
7868
{
0 commit comments