aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-26 12:20:01 +0100
committeremersion <contact@emersion.fr>2017-12-26 12:20:01 +0100
commit998267e2919ba9d41172350ca40d51ff7b700dec (patch)
tree0ca1669fcac79a2f9cbdcb1ddd0306e2afdfde26 /xwayland
parent4a11609b7634356978e48b8b6976922777cf9e61 (diff)
Fix primary selection not sent to xwayland when clipboard is empty
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/selection.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index e59bc4e6..ecc64f2d 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -148,14 +148,18 @@ static void xwm_selection_source_send(struct wlr_xwm_selection *selection,
struct wlr_data_source *source = selection->xwm->seat->selection_source;
if (source != NULL) {
source->send(source, mime_type, fd);
+ return;
}
} else if (selection == &selection->xwm->primary_selection) {
struct wlr_primary_selection_source *source =
selection->xwm->seat->primary_selection_source;
if (source != NULL) {
source->send(source, mime_type, fd);
+ return;
}
}
+
+ wlr_log(L_DEBUG, "not sending selection: no selection source available");
}
static void xwm_selection_send_data(struct wlr_xwm_selection *selection,
@@ -221,6 +225,9 @@ static void xwm_selection_send_targets(struct wlr_xwm_selection *selection) {
struct wl_array *mime_types = xwm_selection_source_get_mime_types(selection);
if (mime_types == NULL) {
+ wlr_log(L_DEBUG, "not sending selection targets: "
+ "no selection source available");
+ xwm_selection_send_notify(selection, XCB_ATOM_NONE);
return;
}
@@ -309,13 +316,6 @@ static void xwm_handle_selection_request(struct wlr_xwm *xwm,
selection->incr = 0;
selection->flush_property_on_delete = 0;
- if (xwm->seat->selection_source == NULL) {
- wlr_log(L_DEBUG, "not handling selection request: "
- "no selection source assigned to xwayland seat");
- xwm_selection_send_notify(selection, XCB_ATOM_NONE);
- return;
- }
-
// No xwayland surface focused, deny access to clipboard
if (xwm->focus_surface == NULL) {
wlr_log(L_DEBUG, "denying read access to clipboard: "