[Commits] [SCM] claws branch, gtk3, updated. 3.99.0-47-g7626388b4
paul at claws-mail.org
paul at claws-mail.org
Tue Mar 9 08:33:28 CET 2021
The branch, gtk3 has been updated
via 7626388b45d8bd87b2f78cd89f76b52e9116bf7c (commit)
from b7e8f5299b20bba15aca74d4d6702aef4ad6d94f (commit)
Summary of changes:
configure.ac | 2 +-
src/gtk/gtkcmctree.c | 21 ++++++++++++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 7626388b45d8bd87b2f78cd89f76b52e9116bf7c
Author: Jonathan Boeing <jonathan.n.boeing at gmail.com>
Date: Sun Feb 28 18:56:08 2021 -0700
Double-buffer row drawing in gtkcmctree
This patch fixes the slowness seen when redrawing the folder tree with
cairo > 1.10 on Windows. It also improves the occasionally visible
flickering in the folder tree on Linux and Windows with older versions
of cairo.
diff --git a/configure.ac b/configure.ac
index bb517fc0d..8ae215a70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1234,7 +1234,7 @@ AC_SUBST(GDATA_CFLAGS)
AC_SUBST(GDATA_LIBS)
dnl cairo **********************************************************************
-PKG_CHECK_MODULES(CAIRO, cairo, HAVE_CAIRO=yes, HAVE_CAIRO=no)
+PKG_CHECK_MODULES(CAIRO, cairo >= 1.12.0, HAVE_CAIRO=yes, HAVE_CAIRO=no)
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
diff --git a/src/gtk/gtkcmctree.c b/src/gtk/gtkcmctree.c
index 69580d525..5ea0628f1 100644
--- a/src/gtk/gtkcmctree.c
+++ b/src/gtk/gtkcmctree.c
@@ -599,6 +599,8 @@ draw_row (GtkCMCList *clist,
static GdkColor greybg={0, 0, 0, 0};
static gboolean color_change = TRUE;
cairo_t *cr;
+ cairo_t *cr_hw;
+ cairo_surface_t *image_surface;
GdkColor *fgcolor, *bgcolor;
cm_return_if_fail (clist != NULL);
@@ -667,7 +669,12 @@ draw_row (GtkCMCList *clist,
}
state = clist_row->state;
- cr = gdk_cairo_create(clist->clist_window);
+ cr_hw = gdk_cairo_create(clist->clist_window);
+ image_surface = cairo_surface_create_similar_image(cairo_get_target(cr_hw),
+ CAIRO_FORMAT_RGB24,
+ gdk_window_get_width(clist->clist_window),
+ gdk_window_get_height(clist->clist_window));
+ cr = cairo_create(image_surface);
if (clist_row->fg_set && state != GTK_STATE_SELECTED)
fgcolor = &clist_row->foreground;
@@ -937,7 +944,19 @@ draw_row (GtkCMCList *clist,
cairo_stroke(cr);
}
}
+
+ cairo_set_operator(cr_hw, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_surface(cr_hw, image_surface, 0, 0);
+ cairo_rectangle(cr_hw,
+ row_rectangle.x,
+ row_rectangle.y - CELL_SPACING,
+ row_rectangle.width,
+ row_rectangle.height + CELL_SPACING * 2);
+ cairo_fill(cr_hw);
+
cairo_destroy(cr);
+ cairo_surface_destroy(image_surface);
+ cairo_destroy(cr_hw);
}
static void
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list