diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2014-05-19 03:19:09 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2014-05-19 03:19:09 +0200 |
commit | aa160f79ad341fca93367e68b1660544c1715b70 (patch) | |
tree | 916d15dd1fc15a213a3fbd7e9bd305fa1792d80f | |
parent | fd6705942f49e7397f32c37d89e858d943114533 (diff) | |
download | scintilla-mirror-aa160f79ad341fca93367e68b1660544c1715b70.tar.gz |
Fix missing redraws on GTK < 3.9.2
Also, make the recent redraw fixes depend on the GTK version Scintilla
is running against, rather than built against. This allows for the
same build to work with both GTK < 3.9.2 or >= 3.9.2.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 43c83f2c3..17a439952 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -759,9 +759,16 @@ void ScintillaGTK::Initialise() { #else g_signal_connect(G_OBJECT(widtxt), "expose_event", G_CALLBACK(ScintillaGTK::ExposeText), this); - // Avoid background drawing flash - gtk_widget_set_double_buffered(widtxt, FALSE); #endif +#if GTK_CHECK_VERSION(3,0,0) + // we need a runtime check because we don't want double buffering when + // running on >= 3.9.2 + if (gtk_check_version(3,9,2) != NULL /* on < 3.9.2 */) +#endif + { + // Avoid background drawing flash/missing redraws + gtk_widget_set_double_buffered(widtxt, FALSE); + } gtk_widget_set_events(widtxt, GDK_EXPOSURE_MASK); gtk_widget_set_size_request(widtxt, 100, 100); adjustmentv = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 201.0, 1.0, 20.0, 20.0)); @@ -2444,9 +2451,12 @@ gboolean ScintillaGTK::DrawThis(cairo_t *cr) { // Starting from the following version, the expose event are not propagated // for double buffered non native windows, so we need to call it ourselves // or keep the default handler -#if GTK_CHECK_VERSION(3,9,2) - gtk_container_propagate_draw( - GTK_CONTAINER(PWidget(wMain)), PWidget(wText), cr); +#if GTK_CHECK_VERSION(3,0,0) + // we want to forward on any >= 3.9.2 runtime + if (gtk_check_version(3,9,2) == NULL) { + gtk_container_propagate_draw( + GTK_CONTAINER(PWidget(wMain)), PWidget(wText), cr); + } #endif } catch (...) { errorStatus = SC_STATUS_FAILURE; |