[Xfce4-commits] <tumbler:jeromeg/webkit-thumbnailer-rebased> Move the capturing routine in a idle handler.
Jérôme Guelfucci
noreply at xfce.org
Sun Feb 24 14:42:12 CET 2013
Updating branch refs/heads/jeromeg/webkit-thumbnailer-rebased
to 42789b020901fb85d90899487e947e7cd049a16d (commit)
from 45d54da553dcaebf2de100829f31bad9f973ca0d (commit)
commit 42789b020901fb85d90899487e947e7cd049a16d
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Sat Jun 4 13:35:58 2011 +0200
Move the capturing routine in a idle handler.
plugins/webkit-thumbnailer/webkit-thumbnailer.c | 28 +++++++++++++++++-----
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/plugins/webkit-thumbnailer/webkit-thumbnailer.c b/plugins/webkit-thumbnailer/webkit-thumbnailer.c
index f79dcfe..4314091 100644
--- a/plugins/webkit-thumbnailer/webkit-thumbnailer.c
+++ b/plugins/webkit-thumbnailer/webkit-thumbnailer.c
@@ -99,6 +99,25 @@ webkit_thumbnailer_class_finalize (WebkitThumbnailerClass *klass)
+static gboolean
+cb_view_loaded_idle (gpointer webkit_thumbnailer)
+{
+ WebkitThumbnailer *thumbnailer;
+
+ thumbnailer = WEBKIT_THUMBNAILER (webkit_thumbnailer);
+
+ /* snapshot the offscreen window */
+ thumbnailer->tmp =
+ gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (thumbnailer->offscreen));
+
+ /* done, exit the main loop */
+ gtk_main_quit ();
+
+ return FALSE;
+}
+
+
+
static void
cb_view_load_finished (GtkWidget *web_view,
WebKitWebFrame *web_frame,
@@ -106,16 +125,11 @@ cb_view_load_finished (GtkWidget *web_view,
{
/* force a redraw of the offscreen window to make sure we snapshot
* the latest visual changes */
- gtk_widget_queue_draw (web_view);
+ gtk_widget_queue_draw (thumbnailer->view);
gdk_window_process_updates (gtk_widget_get_window (thumbnailer->offscreen),
TRUE);
- /* snapshot the offscreen window */
- thumbnailer->tmp =
- gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (thumbnailer->offscreen));
-
- /* done, exit the main loop */
- gtk_main_quit ();
+ g_idle_add (cb_view_loaded_idle, thumbnailer);
}
More information about the Xfce4-commits
mailing list