Commit db9a5e3d authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Popup completion if paste is at the end (patch was already in 2.8.x).

2006-08-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c (paste_received): Popup completion if paste
	is at the end (patch was already in 2.8.x).  (#165714,
	Christian Persch)
parent 0182cf8c
2006-08-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (paste_received): Popup completion if paste
is at the end (patch was already in 2.8.x). (#165714,
Christian Persch)
* gtk/gtknotebook.c (gtk_notebook_set_current_page): Explain
some quirks of this function. (#351112)
......
2006-08-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (paste_received): Popup completion if paste
is at the end (patch was already in 2.8.x). (#165714,
Christian Persch)
* gtk/gtknotebook.c (gtk_notebook_set_current_page): Explain
some quirks of this function. (#351112)
......
......@@ -3950,16 +3950,24 @@ paste_received (GtkClipboard *clipboard,
{
gint pos, start, end;
gint length = -1;
GtkEntryCompletion *completion = gtk_entry_get_completion (entry);
gboolean popup_completion;
GtkEntryCompletion *completion;
completion = gtk_entry_get_completion (entry);
if (entry->truncate_multiline)
length = truncate_multiline (text);
/* only complete if the selection is at the end */
popup_completion = (entry->text_length == MAX (entry->current_pos, entry->selection_bound));
if (completion)
{
g_signal_handler_block (entry, completion->priv->changed_id);
if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
_gtk_entry_completion_popdown (completion);
if (!popup_completion && completion->priv->changed_id > 0)
g_signal_handler_block (entry, completion->priv->changed_id);
}
if (gtk_editable_get_selection_bounds (editable, &start, &end))
......@@ -3969,7 +3977,8 @@ paste_received (GtkClipboard *clipboard,
gtk_editable_insert_text (editable, text, length, &pos);
gtk_editable_set_position (editable, pos);
if (completion)
if (completion &&
!popup_completion && completion->priv->changed_id > 0)
g_signal_handler_unblock (entry, completion->priv->changed_id);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment