diff options
author | Marek Kašík <mkasik@redhat.com> | 2008-11-18 23:55:00 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2008-11-18 23:55:00 (GMT) |
commit | 522d2b9c2a71f477fdfa21d12dad6d7f3c6ebf6e (patch) | |
tree | 8217945206978349ca62e6826f9d4606fa41aa9b /shell/ev-pixbuf-cache.c | |
parent | a20cf6aaf721d5ad453ed704fd33707d9f72c60a (diff) |
Fixes crash on fast scrolling with simultaneous text selection.
2008-11-19 Marek Kašík <mkasik@redhat.com>
* shell/ev-pixbuf-cache.c (new_selection_surface_needed),
(ev_pixbuf_cache_get_selection_surface):
Fixes crash on fast scrolling with simultaneous text selection.
svn path=/trunk/; revision=3272
Diffstat (limited to 'shell/ev-pixbuf-cache.c')
-rw-r--r-- | shell/ev-pixbuf-cache.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/shell/ev-pixbuf-cache.c b/shell/ev-pixbuf-cache.c index ffa0377..46976af 100644 --- a/shell/ev-pixbuf-cache.c +++ b/shell/ev-pixbuf-cache.c @@ -856,7 +856,7 @@ new_selection_surface_needed (EvPixbufCache *pixbuf_cache, { EvPageCache *page_cache; - if (job_info->selection) { + if (job_info->selection && job_info->rc) { gint width, height; gint selection_width, selection_height; @@ -982,8 +982,15 @@ ev_pixbuf_cache_get_selection_surface (EvPixbufCache *pixbuf_cache, if (!job_info->points_set) return NULL; + /* Create new render context if needed (selection + fast scrolling) */ + if (job_info->rc == NULL) { + EvPage *ev_page; + ev_page = ev_document_get_page (pixbuf_cache->document, page); + job_info->rc = ev_render_context_new (ev_page, 0, scale); + g_object_unref (ev_page); + } + /* Update the rc */ - g_assert (job_info->rc); ev_render_context_set_scale (job_info->rc, scale); /* If we have a running job, we just return what we have under the |