Skip to content

PushStyleColor/PopStyleColor inconsistency between docked and window mode #2539

@WeiPhil

Description

@WeiPhil

Version/Branch of Dear ImGui and Build config:

Dear ImGui 1.70 WIP (16991)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: __APPLE__
define: __GNUC__=4
define: __clang_version__=8.0.0 (tags/RELEASE_800/final)
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000041
 NavEnableKeyboard
 DockingEnable
io.ConfigViewportsNoDecoration
io.ConfigMacOSXBehaviors
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.BackendFlags: 0x00001406
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 RendererHasViewports
--------------------------------
io.Fonts: 6 fonts, Flags: 0x00000000, TexSize: 512,1024
io.DisplaySize: 1419.00,1080.00
io.DisplayFramebufferScale: 2.00,2.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 6.00,4.00
style.FrameRounding: 3.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 10.00,4.00
style.ItemInnerSpacing: 4.00,4.00

My Issue/Question:

I wanted to give a specific window a color by using the PushStyleColor/PopStyleColor function but it seems like the comportment when a window is docked is not as I would expect it. I don't know if it's intended but if it's not the case there must be some issue with the handling of docked windows and their style.

The expected behaviour I would await would be a consistent background color of the window in both docked and window mode.

Screenshots/Video

Two screenshot illustrating the window docked and undocked.

image

image

Standalone, minimal, complete and verifiable example:

ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(1.0f, 0.4f, 0.4f, 1.0f));

ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver);

ImGui::Begin("OpenGL View");

[ ... ]

ImGui::End();

ImGui::PopStyleColor();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions