]> www.fi.muni.cz Git - evince.git/commitdiff
Fixes crash on fast scrolling with simultaneous text selection.
authorMarek Kašík <mkasik@redhat.com>
Tue, 18 Nov 2008 23:55:00 +0000 (23:55 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 18 Nov 2008 23:55:00 +0000 (23:55 +0000)
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

ChangeLog
shell/ev-pixbuf-cache.c

index 5b23292b305d518860bf1f5dcc5a1345b3b7352b..343dee7b651aa2870429e6ead0941484e827270e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
 2008-11-19  Marek Kašík <mkasik@redhat.com>
 
        * shell/ev-pixbuf-cache.c (ev_pixbuf_cache_add_jobs_if_needed):
index ffa03772b51595585d3d4998467fb39e7fa18d58..46976afe2d23b564912204b0fe3459523c477d9a 100644 (file)
@@ -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