aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-15 09:42:42 +0100
committeremersion <contact@emersion.fr>2017-12-15 09:42:42 +0100
commit810c4b119bcce2c55ddca8933cbc89381602674b (patch)
treeb5ce385818ad9627c8ef4fb866e9116300f89970 /xwayland/selection.c
parent76dcb694c142ca7ef288916076b446ae6f7baafa (diff)
Fix clipboard from xwayland to wayland
Diffstat (limited to 'xwayland/selection.c')
-rw-r--r--xwayland/selection.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 062fbf9c..25386b1a 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -541,16 +541,17 @@ static void xwm_handle_selection_notify(struct wlr_xwm *xwm,
return;
}
- // No xwayland surface focused, deny access to clipboard
- if (xwm->focus_surface == NULL) {
- wlr_log(L_DEBUG, "denying write access to clipboard: "
- "no xwayland surface focused");
- return;
- }
-
if (selection_notify->property == XCB_ATOM_NONE) {
wlr_log(L_ERROR, "convert selection failed");
} else if (selection_notify->target == xwm->atoms[TARGETS]) {
+ // No xwayland surface focused, deny access to clipboard
+ if (xwm->focus_surface == NULL) {
+ wlr_log(L_DEBUG, "denying write access to clipboard: "
+ "no xwayland surface focused");
+ return;
+ }
+
+ // This sets the Wayland clipboard (by calling wlr_seat_set_selection)
xwm_get_selection_targets(xwm);
} else {
xwm_get_selection_data(xwm);