]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxBufferedPaintDC for wxStyledTextCtrl drawing in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 24 Nov 2012 00:33:44 +0000 (00:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 24 Nov 2012 00:33:44 +0000 (00:33 +0000)
GTK+ doesn't seem to use double buffering for Scintilla window for some
reason, resulting in bad flicker when it's updated, e.g. when the user types
into it.

Force the use of double buffering at wxWidgets level by using
wxBufferedPaintDC for painting it. This may be inefficient if GTK+ does double
buffer it in some cases but at least it gets rid of the flicker.

Closes #12704, #14828.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/stc/stc.cpp
src/stc/stc.cpp.in

index 1fa360de2d6af27e1f2f9533f12427b1cb0b9876..f1cfe240df12143c2a2738950b5db81104d317a7 100644 (file)
     #include "wx/ffile.h"
 #endif
 
+#ifdef __WXGTK__
+    #include "wx/dcbuffer.h"
+#endif
+
 #include "ScintillaWX.h"
 
 //----------------------------------------------------------------------
@@ -4612,7 +4616,11 @@ void wxStyledTextCtrl::AppendTextRaw(const char* text, int length)
 // Event handlers
 
 void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) {
+#ifdef __WXGTK__
+    wxBufferedPaintDC dc(this);
+#else
     wxPaintDC dc(this);
+#endif
     m_swx->DoPaint(&dc, GetUpdateRegion().GetBox());
 }
 
index d63a1f9fc428c0a9ba69b1209085a2accfe2d3ce..eec517db9fff3cd9de2b3efec9028119618d047a 100644 (file)
     #include "wx/ffile.h"
 #endif
 
+#ifdef __WXGTK__
+    #include "wx/dcbuffer.h"
+#endif
+
 #include "ScintillaWX.h"
 
 //----------------------------------------------------------------------
@@ -750,7 +754,11 @@ void wxStyledTextCtrl::AppendTextRaw(const char* text, int length)
 // Event handlers
 
 void wxStyledTextCtrl::OnPaint(wxPaintEvent& WXUNUSED(evt)) {
+#ifdef __WXGTK__
+    wxBufferedPaintDC dc(this);
+#else
     wxPaintDC dc(this);
+#endif
     m_swx->DoPaint(&dc, GetUpdateRegion().GetBox());
 }