summaryrefslogtreecommitdiff
path: root/gtk/gtkpixelcache.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2013-06-03 17:04:03 +0200
committerAlexander Larsson <alexl@redhat.com>2013-07-03 14:34:13 +0200
commitc9b52d8820792abdad5696d7a94235032bcb0108 (patch)
treec37f9a6186051c0456f3250bfab2f153a6d9f8c4 /gtk/gtkpixelcache.c
parent6bf32999b162b972ad8f1ea683c8727e7a1f7273 (diff)
downloadgtk+-c9b52d8820792abdad5696d7a94235032bcb0108.tar.gz
pixel-cache: Refresh pixel cache on window scale factor changes.
Diffstat (limited to 'gtk/gtkpixelcache.c')
-rw-r--r--gtk/gtkpixelcache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkpixelcache.c b/gtk/gtkpixelcache.c
index 9b2f1d83a8..882dbcb67e 100644
--- a/gtk/gtkpixelcache.c
+++ b/gtk/gtkpixelcache.c
@@ -38,6 +38,7 @@ struct _GtkPixelCache {
int surface_y;
int surface_w;
int surface_h;
+ double surface_scale;
/* may be null if not dirty */
cairo_region_t *surface_dirty;
@@ -159,7 +160,8 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache *cache,
cache->surface_w < view_rect->width ||
cache->surface_w > surface_w + ALLOW_LARGER_SIZE ||
cache->surface_h < view_rect->height ||
- cache->surface_h > surface_h + ALLOW_LARGER_SIZE))
+ cache->surface_h > surface_h + ALLOW_LARGER_SIZE ||
+ cache->surface_scale != gdk_window_get_scale_factor (window)))
{
cairo_surface_destroy (cache->surface);
cache->surface = NULL;
@@ -178,6 +180,7 @@ _gtk_pixel_cache_create_surface_if_needed (GtkPixelCache *cache,
cache->surface_y = -canvas_rect->y;
cache->surface_w = surface_w;
cache->surface_h = surface_h;
+ cache->surface_scale = gdk_window_get_scale_factor (window);
cache->surface =
gdk_window_create_similar_surface (window, content,