summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorOwen W. Taylor <[email protected]>2014-03-03 12:44:44 -0500
committerraveit65 <[email protected]>2017-11-03 16:21:05 +0100
commit4287f17c257eb997c013ce4dcf4a0b82643f1c74 (patch)
tree68927b2c2f484045e1bf9574239c241f4a9b7762 /libview
parenta3486a2dbd0588c1f3c749d52a73afbeaba0f9f0 (diff)
downloadatril-4287f17c257eb997c013ce4dcf4a0b82643f1c74.tar.bz2
atril-4287f17c257eb997c013ce4dcf4a0b82643f1c74.tar.xz
EvPixbufCache: Handle backends that don't render a selection
Handle the case where ev_selection_render_selection() doesn't actually render a surface - this happens when a backend doesn't implement render_selection(). https://bugzilla.gnome.org/show_bug.cgi?id=723431 origin commit: https://git.gnome.org/browse/evince/commit/?id=c5a338c fixes https://github.com/mate-desktop/atril/issues/283
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-pixbuf-cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c
index 506d1316..2813288c 100644
--- a/libview/ev-pixbuf-cache.c
+++ b/libview/ev-pixbuf-cache.c
@@ -287,7 +287,8 @@ copy_job_to_job_info (EvJobRender *job_render,
job_info->selection_points = job_render->selection_points;
job_info->selection_region = cairo_region_reference (job_render->selection_region);
job_info->selection = cairo_surface_reference (job_render->selection);
- set_device_scale_on_surface (job_info->selection, job_info->device_scale);
+ if (job_info->selection)
+ set_device_scale_on_surface (job_info->selection, job_info->device_scale);
g_assert (job_info->selection_points.x1 >= 0);
job_info->points_set = TRUE;
}
@@ -1026,7 +1027,8 @@ ev_pixbuf_cache_get_selection_surface (EvPixbufCache *pixbuf_cache,
old_points,
job_info->selection_style,
&text, &base);
- set_device_scale_on_surface (job_info->selection, job_info->device_scale);
+ if (job_info->selection)
+ set_device_scale_on_surface (job_info->selection, job_info->device_scale);
job_info->selection_points = job_info->target_points;
g_object_unref (rc);
ev_document_doc_mutex_unlock ();