diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index a59504bcad1c..79b83ca1f539 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -52,9 +52,7 @@ #include "wx/file.h" #endif -#ifdef __WXGTK__ - #include "wx/dcbuffer.h" -#endif +#include "wx/dcbuffer.h" #include "ScintillaWX.h" @@ -226,6 +224,13 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, // STC doesn't support RTL languages at all SetLayoutDirection(wxLayout_LeftToRight); + // Rely on native double buffering by default. +#if wxALWAYS_NATIVE_DOUBLE_BUFFER + SetBufferedDraw(false); +#else + SetBufferedDraw(true); +#endif + return true; } @@ -5164,11 +5169,7 @@ void wxStyledTextCtrl::StartStyling(int start, int unused) // Event handlers void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) { -#ifdef __WXGTK__ - wxBufferedPaintDC dc(this); -#else wxPaintDC dc(this); -#endif m_swx->DoPaint(&dc, GetUpdateRegion().GetBox()); } diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index bbf17cc1d40a..fc3c80485f22 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -52,9 +52,7 @@ #include "wx/file.h" #endif -#ifdef __WXGTK__ - #include "wx/dcbuffer.h" -#endif +#include "wx/dcbuffer.h" #include "ScintillaWX.h" @@ -226,6 +224,13 @@ bool wxStyledTextCtrl::Create(wxWindow *parent, // STC doesn't support RTL languages at all SetLayoutDirection(wxLayout_LeftToRight); + // Rely on native double buffering by default. +#if wxALWAYS_NATIVE_DOUBLE_BUFFER + SetBufferedDraw(false); +#else + SetBufferedDraw(true); +#endif + return true; } @@ -679,11 +684,7 @@ void wxStyledTextCtrl::StartStyling(int start, int unused) // Event handlers void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) { -#ifdef __WXGTK__ - wxBufferedPaintDC dc(this); -#else wxPaintDC dc(this); -#endif m_swx->DoPaint(&dc, GetUpdateRegion().GetBox()); }