From a2e4cb6cec6cb63121faa2731b39d07225da6d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Mon, 5 Apr 2021 13:04:42 +0200 Subject: [PATCH] Fix wxSplitterWindow painting on macOS 11 Fix regression in wxSplitterWindow rendering introduced in 287ee5e4c7d15273d2f18a6aa77409bb35b1f9aa - the splitter wouldn't correctly render its background under some (but not all) circumstances on macOS 11. Closes https://github.com/wxWidgets/wxWidgets/pull/2306 Fixes #19106 --- src/generic/splitter.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index dc4732baf2..077c991e04 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -97,13 +97,24 @@ bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id, m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0; - // FIXME: with this line the background is not erased at all under GTK1, - // so temporary avoid it there -#if !defined(__WXGTK__) || defined(__WXGTK20__) - // don't erase the splitter background, it's pointless as we overwrite it - // anyhow - SetBackgroundStyle(wxBG_STYLE_PAINT); +#ifdef __WXOSX__ + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16 + if ( WX_IS_MACOS_AVAILABLE(10, 16) ) + { + // Nothing to do: see OnPaint() + } + else + #endif #endif + { + // FIXME: with this line the background is not erased at all under GTK1, + // so temporary avoid it there +#if !defined(__WXGTK__) || defined(__WXGTK20__) + // don't erase the splitter background, it's pointless as we overwrite it + // anyhow + SetBackgroundStyle(wxBG_STYLE_PAINT); +#endif + } return true; }