diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 0a8512278c..dc4732baf2 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -31,6 +31,10 @@ #include "wx/settings.h" #endif +#ifdef __WXOSX__ + #include "wx/osx/private/available.h" +#endif + #include "wx/renderer.h" #include @@ -175,11 +179,23 @@ void wxSplitterWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); #ifdef __WXOSX__ - // as subpanels might have a transparent background we must erase the background - // at least on OSX, otherwise traces of the sash will remain - // test with: splitter sample->replace right window - dc.Clear(); -#endif + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 + if ( WX_IS_MACOS_AVAILABLE(10, 16) ) + { + // Nothing to do: since macOS 10.14, views are layer-backed or using a shared + // layer and explicitly clearing the background isn't needed. This only + // started mattering here with macOS 11 (aka 10.16 when built with older SDK), + // where we must avoid explicitly painting window backgrounds + } + else + #endif + { + // as subpanels might have a transparent background we must erase the background + // at least on OSX, otherwise traces of the sash will remain + // test with: splitter sample->replace right window + dc.Clear(); + } +#endif // __WXOSX__ DrawSash(dc); } diff --git a/src/osx/carbon/frame.cpp b/src/osx/carbon/frame.cpp index 67d8616303..25ee3616a2 100644 --- a/src/osx/carbon/frame.cpp +++ b/src/osx/carbon/frame.cpp @@ -129,7 +129,6 @@ void wxFrame::PositionStatusBar() // Responds to colour changes, and passes event on to children. void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) { - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); Refresh(); #if wxUSE_STATUSBAR diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 470b8ea7ca..81938b9a92 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -152,8 +152,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, wxWindowCreateEvent event(this); HandleWindowEvent(event); - SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE )); - if ( parent ) parent->AddChild(this);