only block/unblock completion->priv->insert_text_id if it is actually

2007-01-26  Michael Natterer  <mitch@imendio.com>

	* 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
This commit is contained in:
Michael Natterer 2007-01-26 11:39:16 +00:00 committed by Michael Natterer
parent 788b391cef
commit 0c5f393ad6
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2007-01-26 Michael Natterer <mitch@imendio.com>
* 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 <mclasen@redhat.com>
* gdk/gdkwindow.c: Reduce locking overhead by not repeatedly getting

View File

@ -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);
}
/**