Skip to content

Fix black popup windows (issue #10129)#1

Open
devin-ai-integration[bot] wants to merge 6 commits into
masterfrom
devin/1775097226-fix-black-popup-windows
Open

Fix black popup windows (issue #10129)#1
devin-ai-integration[bot] wants to merge 6 commits into
masterfrom
devin/1775097226-fix-black-popup-windows

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 2, 2026

Summary

Fixes black popup windows reported in bambulab/BambuStudio#10129.

Root cause: The ImGui base style sets ImGuiCol_WindowBg to a near-black color (0.1, 0.1, 0.1, 0.8) via init_style(). Both render_all_plates_stats ("Statistics of All Plates" popup) and render_legend (GCode legend panel) are rendered outside of any push_toolbar_style() context, so they inherit the dark base style regardless of the user's light/dark mode setting. Similarly, SliceInfoPopup only sets background color on its child m_panel but not on the wxPopupTransientWindow itself, which on Windows results in a black frame.

Changes:

  • render_all_plates_stats: Add explicit ImGuiCol_WindowBg and ImGuiCol_Text style colors with dark/light mode awareness, update PopStyleColor count from 6→8.
  • render_legend: Same fix — add ImGuiCol_WindowBg and ImGuiCol_Text, replace commented-out WindowBg line, update PopStyleColor count from 7→9 in both exit paths (folded and normal).
  • SliceInfoPopup: Add SetBackgroundColour(*wxWHITE) on the popup window itself (consistent with other popups like AmsMappingPopup, SelectMachinePop, etc.).

Review & Testing Checklist for Human

  • Verify Push/Pop style color counts match — this is the highest-risk item. Mismatched counts will corrupt the ImGui style stack. render_all_plates_stats: 8 pushes / 8 pops. render_legend: 9 pushes / 9 pops (two exit paths). Count them carefully.
  • Build and run on Windows — the reported issue is Windows-specific (Win10). Verify the "Statistics of All Plates" popup and Legend panel render with correct backgrounds in both light and dark mode after slicing.
  • Check interaction of SetNextWindowBgAlpha(0.8f) with new ImGuiCol_WindowBg in render_legend — the alpha override is still applied after the explicit WindowBg color push. Verify the legend panel still has the expected semi-transparent appearance.
  • Note: Separator color ternary is a no-opis_dark ? ImVec4(1,1,1,0.6) : ImVec4(1,1,1,0.6) uses the same value for both branches. This preserves existing behavior but could be simplified.

Notes

  • This PR was not build-tested due to the complexity of the C++ build environment. Changes are syntactically simple (adding ImGui style color pushes and a wxWidgets background color call) but should be compiled and visually verified on Windows.
  • The text and background colors used match the values from ImGuiWrapper::push_toolbar_style() to ensure visual consistency with other ImGui panels.

Link to Devin session: https://app.devin.ai/sessions/96ab934b56a34beb97ae5931d266e271
Requested by: @XinZhangBambu


Open in Devin Review

XinZhangBambu and others added 6 commits August 26, 2025 19:39
JIRA: [STUDIO-12867] [STUDIO-12529] [STUDIO-13313]
Change-Id: Ia36b3b1c9835f9d1d30d0178f27837836a6b8175
JIRA: [STUDIO-16267]
Change-Id: Id3692f6d9fdb8d3c52feaca87fa4d9d44eaf238d
- render_all_plates_stats (Statistics of All Plates): Add ImGuiCol_WindowBg
  and ImGuiCol_Text with proper light/dark mode colors. The base ImGui style
  uses a nearly black window background (0.1, 0.1, 0.1, 0.8) and this function
  was not overriding it, causing the popup to appear black.

- render_legend (Legend panel): Same fix - add explicit WindowBg and Text
  colors with dark/light mode support. Remove commented-out WindowBg line.

- SliceInfoPopup (wxWidgets): Add SetBackgroundColour(*wxWHITE) on the popup
  window itself, not just the child m_panel. On Windows, wxPopupTransientWindow
  does not inherit child background colors, causing a black background.

Fixes: bambulab#10129
Co-Authored-By: QingSong <xin.zhang@bambulab.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

ImGui::PushStyleColor(ImGuiCol_Separator, ImVec4(1.0f, 1.0f, 1.0f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_WindowBg, is_dark ? ImGuiWrapper::COL_WINDOW_BG_DARK : ImGuiWrapper::COL_WINDOW_BG);
ImGui::PushStyleColor(ImGuiCol_Text, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.88f) : ImVec4(50 / 255.0f, 58 / 255.0f, 61 / 255.0f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_Separator, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f));
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Separator color ternary is a no-op: dark and light mode values are identical in render_all_plates_stats

At src/slic3r/GUI/GCodeRenderer/BaseRenderer.cpp:691, the ternary is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f) uses the exact same white color for both dark and light mode. This is a copy-paste oversight — every other color push in this block (WindowBg, Text) correctly differentiates between modes. A white separator at 60% opacity will be nearly invisible against the light-mode background (COL_WINDOW_BG), defeating the purpose of the dark-mode fix.

Prompt for agents
In render_all_plates_stats, line 691, the ImGuiCol_Separator push uses the same ImVec4(1.0f, 1.0f, 1.0f, 0.6f) for both the dark and light branches of the ternary. The light-mode branch should use a darker separator color appropriate for the light window background (COL_WINDOW_BG). A similar pattern exists in render_legend at line 1339 of the same file and should be fixed consistently. Look at how Text and WindowBg colors are handled in the same block for the correct pattern of differentiating dark vs light mode colors.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

ImGui::PushStyleColor(ImGuiCol_Separator, ImVec4(1.0f, 1.0f, 1.0f, 0.6f));
ImGui::PushStyleColor(ImGuiCol_WindowBg, is_dark ? ImGuiWrapper::COL_WINDOW_BG_DARK : ImGuiWrapper::COL_WINDOW_BG);
ImGui::PushStyleColor(ImGuiCol_Text, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.88f) : ImVec4(50 / 255.0f, 58 / 255.0f, 61 / 255.0f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_Separator, is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f));
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Separator color ternary is a no-op: dark and light mode values are identical in render_legend

At src/slic3r/GUI/GCodeRenderer/BaseRenderer.cpp:1339, the same copy-paste issue as in render_all_plates_stats: is_dark ? ImVec4(1.0f, 1.0f, 1.0f, 0.6f) : ImVec4(1.0f, 1.0f, 1.0f, 0.6f) produces identical colors for both modes. The light-mode separator will be white-on-light, making it nearly invisible.

Prompt for agents
In render_legend, line 1339, the ImGuiCol_Separator push uses the same ImVec4(1.0f, 1.0f, 1.0f, 0.6f) for both branches of the is_dark ternary. The light-mode branch needs a different, darker separator color suitable for a light background. This is the same issue as line 691 in render_all_plates_stats and both should be fixed consistently.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant