From 25e88a114aa7fc48f5847b09a5f82042c17950c9 Mon Sep 17 00:00:00 2001 From: Lingzhu Xiang Date: Tue, 28 Oct 2014 03:48:28 -0400 Subject: [PATCH] Penalize large render jobs during zooming All but the last jobs during zooming are aborted, so let smaller jobs go faster. --- page-widget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/page-widget.c b/page-widget.c index 6339269..2365252 100644 --- a/page-widget.c +++ b/page-widget.c @@ -458,7 +458,10 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) cairo_set_operator(cairo, CAIRO_OPERATOR_SOURCE); cairo_paint(cairo); cairo_restore(cairo); - zathura_render_request(priv->render_request, g_get_real_time()); + /* All but the last jobs requested here are aborted during zooming. + * Processing and aborting smaller jobs first improves responsiveness. */ + const gint64 penalty = pwidth * pheight; + zathura_render_request(priv->render_request, g_get_real_time() + penalty); return FALSE; }