From 67efefde499d683707050d456846c98527df0ac4 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 2 Jul 2014 15:28:45 +0200 Subject: [PATCH] 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. --- gtk/gtktextbuffer.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 6a03b55f2a..10d41d4d6c 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -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;