From 0c5f393ad6ca6ec059b6267910857732898b2b08 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 26 Jan 2007 11:39:16 +0000 Subject: [PATCH] only block/unblock completion->priv->insert_text_id if it is actually 2007-01-26 Michael Natterer * gtk/gtkentrycompletion.c (gtk_entry_completion_insert_prefix): only block/unblock completion->priv->insert_text_id if it is actually connected. While this can't happen the way GtkEntry itself uses the completion, it's still public API and should not blindly call functions that will spit warnings (fix taken from maemo-gtk). svn path=/trunk/; revision=17215 --- ChangeLog | 9 +++++++++ gtk/gtkentrycompletion.c | 12 ++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24c368dc7b..eb27a33483 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-01-26 Michael Natterer + + * gtk/gtkentrycompletion.c (gtk_entry_completion_insert_prefix): + only block/unblock completion->priv->insert_text_id if it is + actually connected. While this can't happen the way GtkEntry + itself uses the completion, it's still public API and should not + blindly call functions that will spit warnings (fix taken from + maemo-gtk). + 2007-01-25 Matthias Clasen * gdk/gdkwindow.c: Reduce locking overhead by not repeatedly getting diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 474b65764f..ba1a644c1b 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1568,8 +1568,10 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion) gboolean done; gchar *prefix; - g_signal_handler_block (completion->priv->entry, - completion->priv->insert_text_id); + if (completion->priv->insert_text_id > 0) + g_signal_handler_block (completion->priv->entry, + completion->priv->insert_text_id); + prefix = gtk_entry_completion_compute_prefix (completion); if (prefix) { @@ -1577,8 +1579,10 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion) 0, prefix, &done); g_free (prefix); } - g_signal_handler_unblock (completion->priv->entry, - completion->priv->insert_text_id); + + if (completion->priv->insert_text_id > 0) + g_signal_handler_unblock (completion->priv->entry, + completion->priv->insert_text_id); } /**