aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-29 21:29:56 +0100
committerGitHub <noreply@github.com>2017-12-29 21:29:56 +0100
commit80ed4d4d20807f021c473b77d44ce6b464afc0c7 (patch)
tree9842be5bb2107e638fce5e2a2f5f2318df19f453 /xwayland/selection.c
parentc23bd2ab7a020fdbfbb3dd1ee0b3f5c8b5807253 (diff)
parent6ed1884c84f470707ed5e6b56a92d86b51034625 (diff)
Merge pull request #541 from martinetd/xwm_fixes
Fix xwayland restart... and add wlr_seat destroy listener.
Diffstat (limited to 'xwayland/selection.c')
-rw-r--r--xwayland/selection.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/xwayland/selection.c b/xwayland/selection.c
index 00e45182..65599145 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -826,6 +826,29 @@ void xwm_selection_init(struct wlr_xwm *xwm) {
selection_init(xwm, &xwm->primary_selection, xwm->atoms[PRIMARY]);
}
+void xwm_selection_finish(struct wlr_xwm *xwm) {
+ if (!xwm) {
+ return;
+ }
+ if (xwm->selection_window) {
+ xcb_destroy_window(xwm->xcb_conn, xwm->selection_window);
+ }
+ if (xwm->seat) {
+ if (xwm->seat->selection_source &&
+ xwm->seat->selection_source->cancel == data_source_cancel) {
+ wlr_seat_set_selection(xwm->seat, NULL,
+ wl_display_next_serial(xwm->xwayland->wl_display));
+ }
+ if (xwm->seat->primary_selection_source &&
+ xwm->seat->primary_selection_source->cancel == primary_selection_source_cancel) {
+ wlr_seat_set_primary_selection(xwm->seat, NULL,
+ wl_display_next_serial(xwm->xwayland->wl_display));
+ }
+ wlr_xwayland_set_seat(xwm->xwayland, NULL);
+ }
+
+}
+
static void xwm_selection_set_owner(struct wlr_xwm_selection *selection,
bool set) {
if (set) {