textbuffer: 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:28:45 +02:00
parent 8116e3e7b9
commit 67efefde49

View File

@ -3656,13 +3656,12 @@ update_selection_clipboards (GtkTextBuffer *buffer)
/* Even if we already have the selection, we need to update our
* timestamp.
*/
if (!gtk_clipboard_set_with_owner (clipboard,
priv->copy_target_entries,
priv->n_copy_target_entries,
clipboard_get_selection_cb,
clipboard_clear_selection_cb,
G_OBJECT (buffer)))
clipboard_clear_selection_cb (clipboard, buffer);
gtk_clipboard_set_with_owner (clipboard,
priv->copy_target_entries,
priv->n_copy_target_entries,
clipboard_get_selection_cb,
clipboard_clear_selection_cb,
G_OBJECT (buffer));
}
tmp_list = tmp_list->next;