From 9466e50626a914827e9440e1e5d61dccc3050d21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 4 Sep 2013 21:09:24 -0700 Subject: [PATCH] xwm: Only handle selection notify events for CLIPBOARD in selection code --- src/xwayland/selection.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 @@ weston_wm_handle_selection_request(struct weston_wm *wm, } } -static void +static int weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, xcb_generic_event_t *event) { @@ -553,6 +553,9 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, 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 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, wm->selection_owner = XCB_WINDOW_NONE; - return; + return 1; } wm->selection_owner = xfixes_selection_notify->owner; @@ -578,7 +581,7 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, 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 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, xfixes_selection_notify->timestamp); xcb_flush(wm->conn); + + return 1; } int @@ -608,8 +613,7 @@ weston_wm_handle_selection_event(struct weston_wm *wm, 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; -- 2.7.4