summaryrefslogtreecommitdiff
path: root/gtk/gtkappchooserdialog.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2011-03-25 10:53:05 +0100
committerAlexander Larsson <alexl@redhat.com>2011-03-28 12:49:17 +0200
commite274dbbdced7f3f8e6349bdfadcd743326cfa799 (patch)
treec0fea71a27490754c6dcf34b54e1ead9334ead5a /gtk/gtkappchooserdialog.c
parentf5e03849391cd602420aa06fdb449741b8aa75bd (diff)
downloadgtk+-e274dbbdced7f3f8e6349bdfadcd743326cfa799.tar.gz
Ensure we always grab the gdk lock in async callbacks
Async callbacks are delivered in idles, so we need to make sure we get the gdk lock before calling any gdk/gtk stuff. This was missing in a few places.
Diffstat (limited to 'gtk/gtkappchooserdialog.c')
-rw-r--r--gtk/gtkappchooserdialog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 35d1d1f2e3..3f1b798f6e 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -121,6 +121,8 @@ search_for_mimetype_ready_cb (GObject *source,
GtkAppChooserDialog *self = user_data;
GError *error = NULL;
+ gdk_threads_enter ();
+
_gtk_app_chooser_online_search_for_mimetype_finish (online, res, &error);
if (error != NULL)
@@ -133,6 +135,8 @@ search_for_mimetype_ready_cb (GObject *source,
{
gtk_app_chooser_refresh (GTK_APP_CHOOSER (self->priv->app_chooser_widget));
}
+
+ gdk_threads_leave ();
}
static void
@@ -155,6 +159,8 @@ app_chooser_online_get_default_ready_cb (GObject *source,
{
GtkAppChooserDialog *self = user_data;
+ gdk_threads_enter ();
+
self->priv->online = _gtk_app_chooser_online_get_default_finish (source, res);
if (self->priv->online != NULL)
@@ -176,6 +182,8 @@ app_chooser_online_get_default_ready_cb (GObject *source,
gtk_widget_show (self->priv->online_button);
}
+
+ gdk_threads_leave ();
}
static void