Skip to content

Commit

Permalink
Viewports: Don't set ImGuiViewportFlags_NoRendererClear when ImGuiWin…
Browse files Browse the repository at this point in the history
…dowFlags_NoBackground is set. (#3213)
  • Loading branch information
ocornut committed May 11, 2020
1 parent 1e7672a commit 6636cb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6236,7 +6236,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
UpdateViewportPlatformMonitor(window->Viewport);

// Update common viewport flags
ImGuiViewportFlags viewport_flags = (window->Viewport->Flags) & ~(ImGuiViewportFlags_TopMost | ImGuiViewportFlags_NoTaskBarIcon | ImGuiViewportFlags_NoDecoration);
const ImGuiViewportFlags viewport_flags_to_clear = ImGuiViewportFlags_TopMost | ImGuiViewportFlags_NoTaskBarIcon | ImGuiViewportFlags_NoDecoration | ImGuiViewportFlags_NoRendererClear;
ImGuiViewportFlags viewport_flags = window->Viewport->Flags & ~viewport_flags_to_clear;
const bool is_short_lived_floating_window = (flags & (ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup)) != 0;
if (flags & ImGuiWindowFlags_Tooltip)
viewport_flags |= ImGuiViewportFlags_TopMost;
Expand Down Expand Up @@ -6266,7 +6267,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
viewport_flags &= ~window->WindowClass.ViewportFlagsOverrideClear;

// We also tell the back-end that clearing the platform window won't be necessary, as our window is filling the viewport and we have disabled BgAlpha
viewport_flags |= ImGuiViewportFlags_NoRendererClear;
if (!(flags & ImGuiWindowFlags_NoBackground))
viewport_flags &= ~ImGuiViewportFlags_NoRendererClear;

window->Viewport->Flags = viewport_flags;
}

Expand Down

0 comments on commit 6636cb9

Please sign in to comment.