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)
This commit is contained in:
Matthias Clasen 2006-08-16 17:42:54 +00:00 committed by Matthias Clasen
parent 0182cf8ceb
commit db9a5e3d24
3 changed files with 20 additions and 3 deletions

View File

@ -1,5 +1,9 @@
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)

View File

@ -1,5 +1,9 @@
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)

View File

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