aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-14 16:44:30 +0100
committeremersion <contact@emersion.fr>2017-12-14 16:44:30 +0100
commit343efd0c202ba7a2f872f117f6193175f831d97d (patch)
tree8b1e8762b5bfc53af37490999f5d586def1be8ab
parenta4094c82c79e4cfc8f423c09d6c3d41fbe2a333d (diff)
Only reply to clipboard selection events
-rw-r--r--xwayland/selection.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 07f9a68d..d98f006f 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -237,6 +237,10 @@ static void xwm_handle_selection_request(struct wlr_xwm *xwm,
xcb_selection_request_event_t *selection_request =
(xcb_selection_request_event_t *) event;
+ if (selection_request->selection != xwm->atoms[CLIPBOARD]) {
+ return;
+ }
+
xwm->selection_request = *selection_request;
xwm->incr = 0;
xwm->flush_property_on_delete = 0;
@@ -523,6 +527,10 @@ static void xwm_handle_selection_notify(struct wlr_xwm *xwm,
xcb_selection_notify_event_t *selection_notify =
(xcb_selection_notify_event_t *) event;
+ if (selection_notify->selection != xwm->atoms[CLIPBOARD]) {
+ return;
+ }
+
if (selection_notify->property == XCB_ATOM_NONE) {
wlr_log(L_ERROR, "convert selection failed");
} else if (selection_notify->target == xwm->atoms[TARGETS]) {
@@ -537,6 +545,10 @@ static int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm,
xcb_xfixes_selection_notify_event_t *xfixes_selection_notify =
(xcb_xfixes_selection_notify_event_t *) event;
+ if (xfixes_selection_notify->selection != xwm->atoms[CLIPBOARD]) {
+ return 0;
+ }
+
if (xfixes_selection_notify->owner == XCB_WINDOW_NONE) {
if (xwm->selection_owner != xwm->selection_window) {
// A real X client selection went away, not our
@@ -563,7 +575,7 @@ static int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm,
xwm->incr = 0;
// doing this will give a selection notify where we actually handle the sync
xcb_convert_selection(xwm->xcb_conn, xwm->selection_window,
- xwm->atoms[CLIPBOARD],
+ xfixes_selection_notify->selection,
xwm->atoms[TARGETS],
xwm->atoms[WL_SELECTION],
xfixes_selection_notify->timestamp);