Skip to content

Commit

Permalink
Docking: Modals don't need to set ImGuiViewportFlags_NoFocusOnClick. …
Browse files Browse the repository at this point in the history
…This also mitigate the common described by #2445, which becomes particularly bad with unfocused modal. (#1542)
  • Loading branch information
ocornut committed Aug 1, 2019
1 parent 3aa9aae commit 451c756
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 @@ -6131,7 +6131,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// won't steal the OS focus away from their parent window (which may be reflected in OS the title bar decoration).
// Setting _NoFocusOnClick would technically prevent us from bringing back to front in case they are being covered by an OS window from a different app,
// but it shouldn't be much of a problem considering those are already popups that are closed when clicking elsewhere.
if (is_short_lived_floating_window)
if (is_short_lived_floating_window && (flags & ImGuiWindowFlags_Modal) == 0)
viewport_flags |= ImGuiViewportFlags_NoFocusOnAppearing | ImGuiViewportFlags_NoFocusOnClick;

// We can overwrite viewport flags using ImGuiWindowClass (advanced users)
Expand Down

0 comments on commit 451c756

Please sign in to comment.