mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:15:59 +01:00
Do not redraw search results
This commit is contained in:
parent
5d7f332909
commit
1192099f65
1 changed files with 11 additions and 3 deletions
14
zathura.c
14
zathura.c
|
@ -248,6 +248,7 @@ struct
|
||||||
{
|
{
|
||||||
GList* results;
|
GList* results;
|
||||||
int page;
|
int page;
|
||||||
|
gboolean draw;
|
||||||
} Search;
|
} Search;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
@ -435,6 +436,7 @@ init_zathura()
|
||||||
|
|
||||||
Zathura.Search.results = NULL;
|
Zathura.Search.results = NULL;
|
||||||
Zathura.Search.page = 0;
|
Zathura.Search.page = 0;
|
||||||
|
Zathura.Search.draw = TRUE;
|
||||||
|
|
||||||
Zathura.Inotify.fd = inotify_init();
|
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_set_size_request(Zathura.UI.drawing_area, width, height);
|
||||||
gtk_widget_queue_draw(Zathura.UI.drawing_area);
|
gtk_widget_queue_draw(Zathura.UI.drawing_area);
|
||||||
}
|
}
|
||||||
|
@ -3027,9 +3031,13 @@ gboolean cb_draw(GtkWidget* widget, GdkEventExpose* expose, gpointer data)
|
||||||
else
|
else
|
||||||
offset_y = 0;
|
offset_y = 0;
|
||||||
|
|
||||||
GList* list;
|
if(Zathura.Search.draw)
|
||||||
for(list = Zathura.Search.results; list && list->data; list = g_list_next(list))
|
{
|
||||||
highlight_result(Zathura.Search.page, (PopplerRectangle*) list->data);
|
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_set_source_surface(cairo, Zathura.PDF.surface, offset_x, offset_y);
|
||||||
cairo_paint(cairo);
|
cairo_paint(cairo);
|
||||||
|
|
Loading…
Reference in a new issue