[evince] Fix selection of text on Wayland



commit a488079ea9e10615dba54f2a4d69d4dfc0a49684
Author: Marek Kasik <mkasik redhat com>
Date:   Tue Dec 15 17:41:33 2015 +0100

    Fix selection of text on Wayland
    
    Do not clear selection if update of the primary selection failed.
    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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759506

 libview/ev-view.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 9fa0546..f76eca8 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -9262,13 +9262,12 @@ ev_view_update_primary_selection (EvView *ev_view)
                 gtk_target_list_add_text_targets (target_list, 0);
                 targets = gtk_target_table_new_from_list (target_list, &n_targets);
                 gtk_target_list_unref (target_list);
-                
-               if (!gtk_clipboard_set_with_owner (clipboard,
-                                                  targets, n_targets,
-                                                  ev_view_primary_get_cb,
-                                                  ev_view_primary_clear_cb,
-                                                  G_OBJECT (ev_view)))
-                       ev_view_primary_clear_cb (clipboard, ev_view);
+
+               gtk_clipboard_set_with_owner (clipboard,
+                                             targets, n_targets,
+                                             ev_view_primary_get_cb,
+                                             ev_view_primary_clear_cb,
+                                             G_OBJECT (ev_view));
 
                 gtk_target_table_free (targets, n_targets);
        } else {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]