MSW: Window background colors are overridden by default/don't update with dark mode switch (Issue #25755)

15 views
Skip to first unread message

Will Cosgrove

unread,
Sep 2, 2025, 1:56:30 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
willco007 created an issue (wxWidgets/wxWidgets#25755)

Bug description:

On Windows, wxFrame is setting the background color of windows to wxSYS_COLOUR_APPWORKSPACE on Create() here. This is overriding Windows default color OOB, I wonder why this is being done. To remove it I call SetBackgroundColour(wxNullColor) after every wxFrame creation.

Secondly, when toggling Dark/Light mode on Windows, the window background isn't being updated as expected with or without a background color set.

Expected vs observed behaviour:

  1. windows background color is wrong OOB on Windows
  2. when switching from dark to light mode, the background of wxFrame isn't updated

To Reproduce:

Create a default wxFrame window on Windows and show it/toggle dark/light mode

Platform and version information

  • wxWidgets version you use: 3.3.1
  • wxWidgets port you use: wxMSW
  • OS and its version: Windows 11


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755@github.com>

stavros9shadowmen

unread,
Sep 2, 2025, 2:00:42 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
stavros9shadowmen left a comment (wxWidgets/wxWidgets#25755)

I believe this will help. https://www.mediafire.com/file/bns4sju60bw06kq/fix.zip/file


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246300099@github.com>

VZ

unread,
Sep 2, 2025, 5:27:54 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25755)

I think the default background colour is correct (for the light mode). And in any case, this is what it was for ~30 years and so I really don't think we should change it.

However we should update it when the mode changes, of course. But please note that currently this is not at all the only thing that is not updated and some of them are rather difficult to update dynamically.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246840547@github.com>

Will Cosgrove

unread,
Sep 2, 2025, 6:00:15 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25755)

I'm pretty sure the background color is incorrect in light mode - or this particular color is no longer used. It's a dark gray while the various OS windows are light gray. If you clear the color (using SetBackgroundColour(wxNullColor)) you get the default background color that matches the OS.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246926864@github.com>

Will Cosgrove

unread,
Sep 2, 2025, 6:09:01 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25755)

Here are a couple screenshots comparing the File Explorer Properties dialog (a win32 app) to the WX default color (disregard the incorrect UI elements).

Default.png (view on web) NullColor.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246944842@github.com>

VZ

unread,
Sep 2, 2025, 6:12:18 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25755)

The default background colour is what Windows uses (used?) for document-oriented applications, not the dialogs — which use a different colour by default (and always did).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246952663@github.com>

Will Cosgrove

unread,
Sep 2, 2025, 6:14:51 PM (5 days ago) Sep 2
to wx-...@googlegroups.com, Subscribed
willco007 left a comment (wxWidgets/wxWidgets#25755)

I figured that is the reason it is dark. However, shouldn't it only be using that color if you're making a MDI parent frame, not a regular wxFrame?

That said, I understand why you'd be reluctant to change the default color after so many years. If WX could refresh the background color correctly in both the default color case and the null color case when switching from dark/light modes that would be ideal.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25755/3246958004@github.com>

Reply all
Reply to author
Forward
0 new messages