[Spice-commits] src/spice-gtk-session.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 7 07:52:01 UTC 2019


 src/spice-gtk-session.c |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 9af2c481b74077ab7d6cb9d4bf589f9855a302f5
Author: Jakub Janků <jjankuatredhat.com>
Date:   Sun Jan 27 18:14:20 2019 +0100

    clipboard: don't request targets without owner on X11
    
    On X11, if the owner in GdkEventOwnerChange is set to NULL,
    it means there's no data in the clipboard, so it's pointless to
    request targets as the request will fail anyway.
    
    On Wayland, owner is always NULL, so don't do anything there.
    
    Signed-off-by: Jakub Janků <jjanku at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 1a19bca..b48f92a 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -674,6 +674,14 @@ static void clipboard_owner_change(GtkClipboard        *clipboard,
     }
 
     s->clipboard_by_guest[selection] = FALSE;
+
+#ifdef GDK_WINDOWING_X11
+    if (!event->owner && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+        s->clip_hasdata[selection] = FALSE;
+        return;
+    }
+#endif
+
     s->clip_hasdata[selection] = TRUE;
     if (s->auto_clipboard_enable && !read_only(self))
         gtk_clipboard_request_targets(clipboard, clipboard_get_targets,


More information about the Spice-commits mailing list