From 0b0ce4193f97d15c36a4d4795e01177dfde0df29 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 18 May 2015 20:58:29 +0200 Subject: [PATCH] xwayland: Ensure we've got an owner when setting the X selection owner Otherwise we may end up claiming the X selection when there's no wayland selection owner. --- src/wayland/meta-xwayland-selection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-xwayland-selection.c b/src/wayland/meta-xwayland-selection.c index 2b40d8c65..d7a5e69c1 100644 --- a/src/wayland/meta-xwayland-selection.c +++ b/src/wayland/meta-xwayland-selection.c @@ -847,10 +847,10 @@ meta_selection_bridge_ownership_notify (struct wl_listener *listener, if (!owner && selection->window == selection->owner) { - XSetSelectionOwner (xdisplay, selection->selection_atom, - None, selection->timestamp); + XSetSelectionOwner (xdisplay, selection->selection_atom, + None, selection->timestamp); } - else if (selection->source != owner) + else if (owner && selection->source != owner) { XSetSelectionOwner (xdisplay, selection->selection_atom,