xwm: Only handle selection notify events for CLIPBOARD in selection code

This commit is contained in:
Kristian Høgsberg
2013-09-04 21:09:24 -07:00
parent 668fc0de0b
commit 9466e50626
+9 -5
View File
@@ -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, weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm,
xcb_generic_event_t *event) 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); struct weston_seat *seat = weston_wm_pick_seat(wm);
uint32_t serial; uint32_t serial;
if (xfixes_selection_notify->selection != wm->atom.clipboard)
return 0;
weston_log("xfixes selection notify event: owner %d\n", weston_log("xfixes selection notify event: owner %d\n",
xfixes_selection_notify->owner); xfixes_selection_notify->owner);
@@ -567,7 +570,7 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm,
wm->selection_owner = XCB_WINDOW_NONE; wm->selection_owner = XCB_WINDOW_NONE;
return; return 1;
} }
wm->selection_owner = xfixes_selection_notify->owner; 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) { if (xfixes_selection_notify->owner == wm->selection_window) {
wm->selection_timestamp = xfixes_selection_notify->timestamp; wm->selection_timestamp = xfixes_selection_notify->timestamp;
weston_log("our window, skipping\n"); weston_log("our window, skipping\n");
return; return 1;
} }
wm->incr = 0; wm->incr = 0;
@@ -589,6 +592,8 @@ weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm,
xfixes_selection_notify->timestamp); xfixes_selection_notify->timestamp);
xcb_flush(wm->conn); xcb_flush(wm->conn);
return 1;
} }
int int
@@ -608,8 +613,7 @@ weston_wm_handle_selection_event(struct weston_wm *wm,
switch (event->response_type - wm->xfixes->first_event) { switch (event->response_type - wm->xfixes->first_event) {
case XCB_XFIXES_SELECTION_NOTIFY: case XCB_XFIXES_SELECTION_NOTIFY:
weston_wm_handle_xfixes_selection_notify(wm, event); return weston_wm_handle_xfixes_selection_notify(wm, event);
return 1;
} }
return 0; return 0;