OSX transparent background (PR #26309)

66 views
Skip to first unread message

Stefan Csomor

unread,
Mar 18, 2026, 11:58:30 AMMar 18
to wx-...@googlegroups.com, Subscribed

fixes regression, allow tlw backgrounds changing according to desktop background, see #26301


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26309

Commit Summary

  • 5c34b5d make default bg color transparent

File Changes

(2 files)

Patch Links:


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/pull/26309@github.com>

Stefan Csomor

unread,
Mar 18, 2026, 1:11:59 PMMar 18
to wx-...@googlegroups.com, Push

@csomor pushed 1 commit.


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/before/5c34b5d555f1f47c6bacbc2433760597d32307a9/after/9f062b6d5a3cc45eecaa31f10bb429665427d429@github.com>

VZ

unread,
Apr 4, 2026, 11:02:17 AMApr 4
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26309)

Stefan, should I merge this one or do you think it needs more testing (unlikely to happen as long as it's not merged, IME...)?


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/pull/26309/c4187240546@github.com>

Stefan Csomor

unread,
Apr 4, 2026, 11:55:27 AMApr 4
to wx-...@googlegroups.com, Subscribed
csomor left a comment (wxWidgets/wxWidgets#26309)

Stefan, should I merge this one or do you think it needs more testing (unlikely to happen as long as it's not merged, IME...)?

Hi Vadim, no sorry, #26301 already mentions some things that don't look right


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/pull/26309/c4187312325@github.com>

VZ

unread,
Apr 4, 2026, 12:36:43 PMApr 4
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26309)

OK, I'll mark it as being WIP too then — please remove the label when it's ready to merge (or close it if it finally doesn't work). TIA!


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/pull/26309/c4187376893@github.com>

Ryan Ogurek

unread,
May 28, 2026, 1:30:40 AMMay 28
to wx-...@googlegroups.com, Subscribed
ryancog left a comment (wxWidgets/wxWidgets#26309)

@csomor For wxTextCtrl (and wxSpinCtrl, wxSearchCtrl), you're just missing an override attributes getter, since wxTextCtrl has its own override which uses wxControlBase::GetCompositeControlsDefaultAttributes().

The following patch fixes the appearance for me:

diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp
index 672139f3e8..3865ed8c3c 100644
--- a/src/common/ctrlcmn.cpp
+++ b/src/common/ctrlcmn.cpp
@@ -236,7 +236,11 @@ wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(va
     wxVisualAttributes attrs;
     attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+#   ifdef __WXOSX__
+    attrs.colBg = wxTransparentColour;
+#   elif
     attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
+#   endif

     return attrs;
 }

For some reason I don't understand, adding an override in the OSX wxTextCtrl in the same vein as what you've done in this PR branch for wxWindowMac/wxWindow doesn't seem to apply to the wxSearchCtrl... maybe I'm missing something though.

In any case, the wxSpinCtrl uses a generic implementation on wxOSX, (as does wxOwnerDrawnComboBox and wxBitmapComboBox) and so the appearance needs to be overridden there too, but these all use wxControlBase::GetCompositeControlsDefaultAttributes(), so it seems simpler to just set the transparent background there.

Beyond those, the only other abnormality I see is with wxDatePickerCtrl, wxTimePickerCtrl (those two I figure is a similar case), and wxListCtrl and friends, which I'll look into next.

Of course, there's the other generic controls I mentioned which have a opaque background on 3.3.0 also, which I want to look into as well...


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

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/c4561088860@github.com>

Ryan Ogurek

unread,
Jun 1, 2026, 4:30:34 AMJun 1
to wx-...@googlegroups.com, Subscribed
ryancog left a comment (wxWidgets/wxWidgets#26309)

As something of an aside, the controlBackgroundColor used for wxSYS_COLOUR_WINDOW and wxSYS_COLOUR_LISTBOX is noted in the documentation:

Do not use this color for drawing. Instead, use an NSVisualEffectView with the appropriate background material.

So it seems like maybe this is the wrong color to return in wxSystemSettingsNative::GetColour()?


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

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/c4590858558@github.com>

Stefan Csomor

unread,
Jul 6, 2026, 9:06:23 AM (2 days ago) Jul 6
to wx-...@googlegroups.com, Push

@csomor pushed 1 commit.

  • 43789fa don’t erase when no bg color given on macos


View it on GitHub or unsubscribe.


Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/before/9f062b6d5a3cc45eecaa31f10bb429665427d429/after/43789fa80715a665f96a36150f4fb48b4b95df8d@github.com>

Stefan Csomor

unread,
Jul 6, 2026, 9:10:52 AM (2 days ago) Jul 6
to wx-...@googlegroups.com, Subscribed
csomor left a comment (wxWidgets/wxWidgets#26309)

@vadz, @vslavik the latest commit to #26309 should undo some damage: your modified dataview now draws correctly in my sandbox again.
I could not reproduce the problem with setting the background color in the PR. But I see that if someone tries to change the background color in a control that is having HasTransparentBackground set to true - thus wxBG_STYLE_TRANSPARENT - there setting the bg colour would be ignored.


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

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/c4893165115@github.com>

VZ

unread,
Jul 7, 2026, 2:58:52 PM (21 hours ago) Jul 7
to wx-...@googlegroups.com, Subscribed

Closed #26309.


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

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/issue_event/27680393252@github.com>

VZ

unread,
Jul 7, 2026, 2:58:54 PM (21 hours ago) Jul 7
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26309)

Merged as 565553e (Make default background color transparent in wxOSX, 2026-03-18)


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

Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26309/c4907412974@github.com>

Reply all
Reply to author
Forward
0 new messages