---
 callbacks.c   |    3 +++
 page-widget.c |    9 +++++++++
 page-widget.h |    8 ++++++++
 3 files changed, 20 insertions(+)

diff --git a/callbacks.c b/callbacks.c
index 2c63945..89eacaf 100644
--- a/callbacks.c
+++ b/callbacks.c
@@ -102,6 +102,9 @@ cb_view_vadjustment_value_changed(GtkAdjustment* 
GIRARA_UNUSED(adjustment), gpoi
       }
     } else {
       zathura_page_set_visibility(page, false);
+      if (zathura_page_widget_get_surface(ZATHURA_PAGE(page_widget)) != NULL) {
+       zathura_page_widget_update_surface(ZATHURA_PAGE(page_widget), NULL);
+      }
     }
     zathura_page_widget_update_view_time(ZATHURA_PAGE(page_widget));
   }
diff --git a/page-widget.c b/page-widget.c
index bf94ba3..42ce131 100644
--- a/page-widget.c
+++ b/page-widget.c
@@ -501,6 +501,15 @@ zathura_page_widget_update_surface(ZathuraPage* widget, 
cairo_surface_t* surface
   zathura_page_widget_redraw_canvas(widget);
 }
 
+cairo_surface_t*
+zathura_page_widget_get_surface(ZathuraPage* widget)
+{
+  g_return_val_if_fail(ZATHURA_IS_PAGE(widget) == TRUE, NULL);
+  zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget);
+
+  return priv->surface;
+}
+
 static void
 zathura_page_widget_size_allocate(GtkWidget* widget, GdkRectangle* allocation)
 {
diff --git a/page-widget.h b/page-widget.h
index fe0b67a..b2aa5ec 100644
--- a/page-widget.h
+++ b/page-widget.h
@@ -59,6 +59,14 @@ GtkWidget* zathura_page_widget_new(zathura_t* zathura, 
zathura_page_t* page);
  * @param surface the new surface
  */
 void zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* 
surface);
+
+/**
+ * Retunrs a pointer to the cairo surface object associated with the given 
page widget.
+ * @param widget the page widget
+ * @return a pointer to a cairo surface object
+ */
+cairo_surface_t* zathura_page_widget_get_surface(ZathuraPage* widget);
+
 /**
  * Draw a rectangle to mark links or search results
  * @param widget the widget
-- 
1.7.10.4

_______________________________________________
zathura mailing list
zathura@lists.pwmt.org
http://lists.pwmt.org/mailman/listinfo/zathura

Reply via email to