From 2587d4b8e6542ec578632c311309a3f4d13f0b3e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 9 Apr 2014 23:31:21 +0200 Subject: pixelcache: Add map/unmap functions Because GTK does not invalidate windows that aren't mapped, we cannot update the pixel cache when the window it handles isn't mapped. So we add API to call when GDK windows get mapped/unmapped. https://bugzilla.gnome.org/show_bug.cgi?id=726475 --- gtk/gtkpixelcache.c | 12 ++++++++++++ gtk/gtkpixelcacheprivate.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'gtk') diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c index 2a909641f7..339518bf8a 100644 --- a/gtk/gtkpixelcache.c +++ b/gtk/gtkpixelcache.c @@ -467,3 +467,15 @@ _gtk_pixel_cache_draw (GtkPixelCache *cache, draw (cr, user_data); } } + +void +_gtk_pixel_cache_map (GtkPixelCache *cache) +{ + _gtk_pixel_cache_invalidate (cache, NULL); +} + +void +_gtk_pixel_cache_unmap (GtkPixelCache *cache) +{ + gtk_pixel_cache_blow_cache (cache); +} diff --git a/gtk/gtkpixelcacheprivate.h b/gtk/gtkpixelcacheprivate.h index 69635b7df2..c31693e140 100644 --- a/gtk/gtkpixelcacheprivate.h +++ b/gtk/gtkpixelcacheprivate.h @@ -32,6 +32,8 @@ typedef void (*GtkPixelCacheDrawFunc) (cairo_t *cr, GtkPixelCache *_gtk_pixel_cache_new (void); void _gtk_pixel_cache_free (GtkPixelCache *cache); +void _gtk_pixel_cache_map (GtkPixelCache *cache); +void _gtk_pixel_cache_unmap (GtkPixelCache *cache); void _gtk_pixel_cache_invalidate (GtkPixelCache *cache, cairo_region_t *region); void _gtk_pixel_cache_draw (GtkPixelCache *cache, -- cgit v1.2.1