From 1bcde69a73e835df8faa8b02c3ec838e0adb3dc4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 2 Oct 2019 02:43:56 +0200 Subject: [PATCH] Use white in wxDC::Clear() if background brush is reset in wxGTK2 Although white background was used if the brush was never set, setting and resetting it nothing unexpectedly (and inconsistently with the other ports) resulted in using black background. Fix this by just resetting the brush to white if it's invalid, instead of not setting it at all. --- src/gtk/dcclient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 4ccd8ddc71..de7fef4706 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1738,7 +1738,8 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) m_backgroundBrush = brush; - if (!m_backgroundBrush.IsOk()) return; + if (!m_backgroundBrush.IsOk()) + m_backgroundBrush = *wxWHITE_BRUSH; if (!m_gdkwindow) return;