Commit fc8be961 authored by Olivier Brunel's avatar Olivier Brunel Committed by Matthias Clasen

gtkpixelcache: Fix possibly ignoring queued redraw

If a queue_redraw() (invalidating a region, or the whole widget) was
called from the draw() call, it could get ignored if surface_dirty
existed, as it would then be updated, but destroyed right at the end of
the _gtk_pixel_cache_repaint(), leading the next call to
_gtk_pixel_cache_draw() have its call to repaint() be a no-op
(since there's no surface_dirty) and then simply draw from (non
updated) surface.
Signed-off-by: 's avatarOlivier Brunel <>
parent fbfeb005
......@@ -327,13 +327,15 @@ _gtk_pixel_cache_repaint (GtkPixelCache *cache,
gpointer user_data)
cairo_t *backing_cr;
cairo_region_t *region_dirty = cache->surface_dirty;
cache->surface_dirty = NULL;
if (cache->surface &&
cache->surface_dirty &&
!cairo_region_is_empty (cache->surface_dirty))
region_dirty &&
!cairo_region_is_empty (region_dirty))
backing_cr = cairo_create (cache->surface);
gdk_cairo_region (backing_cr, cache->surface_dirty);
gdk_cairo_region (backing_cr, region_dirty);
cairo_clip (backing_cr);
cairo_translate (backing_cr,
-cache->surface_x - canvas_rect->x - view_rect->x,
......@@ -370,11 +372,8 @@ _gtk_pixel_cache_repaint (GtkPixelCache *cache,
cairo_destroy (backing_cr);
if (cache->surface_dirty)
cairo_region_destroy (cache->surface_dirty);
cache->surface_dirty = NULL;
if (region_dirty)
cairo_region_destroy (region_dirty);
static gboolean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment