From 1192099f65f27e0b47d6ffd037ffc64258cc8e88 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Thu, 13 May 2010 11:39:20 +0200 Subject: [PATCH] Do not redraw search results --- zathura.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/zathura.c b/zathura.c index 6ee11d1..3338fe0 100644 --- a/zathura.c +++ b/zathura.c @@ -248,6 +248,7 @@ struct { GList* results; int page; + gboolean draw; } Search; struct @@ -435,6 +436,7 @@ init_zathura() Zathura.Search.results = NULL; Zathura.Search.page = 0; + Zathura.Search.draw = TRUE; Zathura.Inotify.fd = inotify_init(); @@ -707,6 +709,8 @@ draw(int page_id) } } + Zathura.Search.draw = TRUE; + gtk_widget_set_size_request(Zathura.UI.drawing_area, width, height); gtk_widget_queue_draw(Zathura.UI.drawing_area); } @@ -3027,9 +3031,13 @@ gboolean cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data) else offset_y = 0; - GList* list; - for(list = Zathura.Search.results; list && list->data; list = g_list_next(list)) - highlight_result(Zathura.Search.page, (PopplerRectangle*) list->data); + if(Zathura.Search.draw) + { + GList* list; + for(list = Zathura.Search.results; list && list->data; list = g_list_next(list)) + highlight_result(Zathura.Search.page, (PopplerRectangle*) list->data); + Zathura.Search.draw = FALSE; + } cairo_set_source_surface(cairo, Zathura.PDF.surface, offset_x, offset_y); cairo_paint(cairo);