OSX transparent background (PR #26309)

44 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 AM (7 days ago) May 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 AM (2 days ago) Jun 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>

Reply all
Reply to author
Forward
0 new messages