entry: Do not unset selection if failing to update the primary selection

This is expected to happen on wayland and other platforms with no primary selection,
and just leads to the selected text being cleared after any attempt to change the
text selection itself through either mouse/keyboard.
This commit is contained in:
Carlos Garnacho 2014-07-02 15:35:07 +02:00
parent 67efefde49
commit 5fe9ebfe11

View File

@ -7332,9 +7332,8 @@ gtk_entry_update_primary_selection (GtkEntry *entry)
if (gtk_editable_get_selection_bounds (GTK_EDITABLE (entry), &start, &end))
{
if (!gtk_clipboard_set_with_owner (clipboard, targets, n_targets,
primary_get_cb, primary_clear_cb, G_OBJECT (entry)))
primary_clear_cb (clipboard, entry);
gtk_clipboard_set_with_owner (clipboard, targets, n_targets,
primary_get_cb, primary_clear_cb, G_OBJECT (entry));
}
else
{