From 014b5cc7c99a261eb5ca50237fa9edb3b9427bb6 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Thu, 7 Mar 2024 18:04:51 +0100 Subject: [PATCH] [Linux] Fix blank windows in Simple GUI. This fixes: #4902. Signed-off-by: Vitalii Koshura --- clientgui/sg_DlgMessages.cpp | 4 ++++ clientgui/sg_DlgPreferences.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clientgui/sg_DlgMessages.cpp b/clientgui/sg_DlgMessages.cpp index 868c3e0df0..b41ce42cbe 100644 --- a/clientgui/sg_DlgMessages.cpp +++ b/clientgui/sg_DlgMessages.cpp @@ -187,7 +187,11 @@ void CPanelMessages::OnEraseBackground(wxEraseEvent& event){ wxSize sz = GetClientSize(); // Create a buffered device context to reduce flicker +#ifndef __WXGTK__ wxBufferedDC dc(event.GetDC(), sz, wxBUFFER_CLIENT_AREA); +#else + wxDC &dc = *event.GetDC(); +#endif // bitmap dimensions w = bmp.GetWidth(); diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index ff0c0b7f5d..f51d281950 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -534,9 +534,13 @@ void CPanelPreferences::OnEraseBackground( wxEraseEvent& event ) { if (!m_backgroundBitmap) { MakeBackgroundBitmap(); } - // Create a buffered device context to reduce flicker wxSize sz = GetClientSize(); + // Create a buffered device context to reduce flicker +#ifndef __WXGTK__ wxBufferedDC dc(event.GetDC(), sz, wxBUFFER_CLIENT_AREA); +#else + wxDC &dc = *event.GetDC(); +#endif #if TEST_BACKGROUND_WITH_MAGENTA_FILL // Fill the dialog with a magenta color so people can detect when something