From 2c22dd740c0e12453b08308517c181cfcd3c716e Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 12 Nov 2007 15:49:49 +0000 Subject: [PATCH] * Added several gdk_threads_enter/leave stuff in the callbacks of the timeouts because they need them since the timeouts are executed outside the main lock pmo-trunk-r3711 --- src/maemo/modest-address-book.c | 5 +++++ src/maemo/modest-main-window.c | 8 ++++++++ src/maemo/modest-msg-view-window.c | 5 +++++ src/widgets/modest-folder-view.c | 4 ++-- src/widgets/modest-gtkhtml-msg-view.c | 7 +++++++ 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/maemo/modest-address-book.c b/src/maemo/modest-address-book.c index 711dd0f..8fe6536 100644 --- a/src/maemo/modest-address-book.c +++ b/src/maemo/modest-address-book.c @@ -633,9 +633,14 @@ show_check_names_banner (gpointer data) { GtkWidget **banner = (GtkWidget **) data; + /* We're outside the main lock */ + gdk_threads_enter (); + *banner = hildon_banner_show_animation (NULL, NULL, _("mail_ib_checking_names")); g_object_ref (G_OBJECT (*banner)); + gdk_threads_leave (); + return FALSE; } diff --git a/src/maemo/modest-main-window.c b/src/maemo/modest-main-window.c index 75f0658..1e2090b 100644 --- a/src/maemo/modest-main-window.c +++ b/src/maemo/modest-main-window.c @@ -432,11 +432,15 @@ restore_paned_timeout_handler (gpointer *data) ModestMainWindowPrivate *priv = MODEST_MAIN_WINDOW_GET_PRIVATE (main_window); ModestConf *conf; + /* Timeouts are outside the main lock */ + gdk_threads_enter (); if (GTK_WIDGET_VISIBLE (main_window)) { conf = modest_runtime_get_conf (); modest_widget_memory_restore (conf, G_OBJECT(priv->main_paned), MODEST_CONF_MAIN_PANED_KEY); } + gdk_threads_leave (); + return FALSE; } @@ -2486,9 +2490,13 @@ show_updating_banner (gpointer user_data) priv = MODEST_MAIN_WINDOW_GET_PRIVATE (user_data); if (priv->updating_banner == NULL) { + + /* We're outside the main lock */ + gdk_threads_enter (); priv->updating_banner = modest_platform_animation_banner (GTK_WIDGET (user_data), NULL, _CS ("ckdg_pb_updating")); + gdk_threads_leave (); } /* Remove timeout */ diff --git a/src/maemo/modest-msg-view-window.c b/src/maemo/modest-msg-view-window.c index ca09730..e6064c4 100644 --- a/src/maemo/modest-msg-view-window.c +++ b/src/maemo/modest-msg-view-window.c @@ -2509,6 +2509,9 @@ show_remove_attachment_information (gpointer userdata) ModestMsgViewWindow *window = (ModestMsgViewWindow *) userdata; ModestMsgViewWindowPrivate *priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window); + /* We're outside the main lock */ + gdk_threads_enter (); + if (priv->remove_attachment_banner != NULL) { gtk_widget_destroy (priv->remove_attachment_banner); g_object_unref (priv->remove_attachment_banner); @@ -2517,6 +2520,8 @@ show_remove_attachment_information (gpointer userdata) priv->remove_attachment_banner = g_object_ref ( hildon_banner_show_animation (NULL, NULL, _("mcen_ib_removing_attachment"))); + gdk_threads_leave (); + return FALSE; } diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index 1ffff14..8be8c19 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -2279,7 +2279,7 @@ expand_row_timeout (gpointer data) GtkTreeViewDropPosition pos; gboolean result = FALSE; - GDK_THREADS_ENTER (); + gdk_threads_enter (); gtk_tree_view_get_drag_dest_row (tree_view, &dest_path, @@ -2298,7 +2298,7 @@ expand_row_timeout (gpointer data) result = TRUE; } - GDK_THREADS_LEAVE (); + gdk_threads_leave (); return result; } diff --git a/src/widgets/modest-gtkhtml-msg-view.c b/src/widgets/modest-gtkhtml-msg-view.c index 2151371..f615e2c 100644 --- a/src/widgets/modest-gtkhtml-msg-view.c +++ b/src/widgets/modest-gtkhtml-msg-view.c @@ -969,6 +969,10 @@ html_adjustment_changed (GtkAdjustment *adj, gboolean idle_readjust_scroll (ModestGtkhtmlMsgView *self) { + + /* We're out the main lock */ + gdk_threads_enter (); + if (GTK_WIDGET_DRAWABLE (self)) { ModestGtkhtmlMsgViewPrivate *priv = MODEST_GTKHTML_MSG_VIEW_GET_PRIVATE (self); GtkAdjustment *html_vadj; @@ -985,6 +989,9 @@ idle_readjust_scroll (ModestGtkhtmlMsgView *self) gtk_adjustment_set_value (priv->vadj, 0.0); } g_object_unref (G_OBJECT (self)); + + gdk_threads_leave (); + return FALSE; } -- 1.7.9.5