xwm: Only handle selection notify events for CLIPBOARD in selection code
diff --git a/src/xwayland/selection.c b/src/xwayland/selection.c
index d220569..63c4c3f 100644
--- a/src/xwayland/selection.c
+++ b/src/xwayland/selection.c
@@ -543,7 +543,7 @@
 	}
 }
 
-static void
+static int
 weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm,
 				       xcb_generic_event_t *event)
 {
@@ -553,6 +553,9 @@
 	struct weston_seat *seat = weston_wm_pick_seat(wm);
 	uint32_t serial;
 
+	if (xfixes_selection_notify->selection != wm->atom.clipboard)
+		return 0;
+
 	weston_log("xfixes selection notify event: owner %d\n",
 	       xfixes_selection_notify->owner);
 
@@ -567,7 +570,7 @@
 
 		wm->selection_owner = XCB_WINDOW_NONE;
 
-		return;
+		return 1;
 	}
 
 	wm->selection_owner = xfixes_selection_notify->owner;
@@ -578,7 +581,7 @@
 	if (xfixes_selection_notify->owner == wm->selection_window) {
 		wm->selection_timestamp = xfixes_selection_notify->timestamp;
 		weston_log("our window, skipping\n");
-		return;
+		return 1;
 	}
 
 	wm->incr = 0;
@@ -589,6 +592,8 @@
 			      xfixes_selection_notify->timestamp);
 
 	xcb_flush(wm->conn);
+
+	return 1;
 }
 
 int
@@ -608,8 +613,7 @@
 
 	switch (event->response_type - wm->xfixes->first_event) {
 	case XCB_XFIXES_SELECTION_NOTIFY:
-		weston_wm_handle_xfixes_selection_notify(wm, event);
-		return 1;
+		return weston_wm_handle_xfixes_selection_notify(wm, event);
 	}
 
 	return 0;