aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection
diff options
context:
space:
mode:
Diffstat (limited to 'xwayland/selection')
-rw-r--r--xwayland/selection/incoming.c13
-rw-r--r--xwayland/selection/selection.c7
2 files changed, 11 insertions, 9 deletions
diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c
index d4d7d553..0fe759a0 100644
--- a/xwayland/selection/incoming.c
+++ b/xwayland/selection/incoming.c
@@ -365,9 +365,9 @@ static void xwm_selection_get_targets(struct wlr_xwm_selection *selection) {
bool ok = source_get_targets(selection, &source->base.mime_types,
&source->mime_types_atoms);
- if (ok) {
- wlr_seat_set_gtk_primary_selection(xwm->seat, &source->base,
- wl_display_next_serial(xwm->xwayland->wl_display));
+ if (ok && xwm->xwayland->gtk_primary_selection) {
+ wlr_gtk_primary_selection_device_manager_set_selection(
+ xwm->xwayland->gtk_primary_selection, xwm->seat, &source->base);
} else {
source->base.cancel(&source->base);
}
@@ -423,9 +423,10 @@ int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm,
if (selection == &xwm->clipboard_selection) {
wlr_seat_set_selection(xwm->seat, NULL,
wl_display_next_serial(xwm->xwayland->wl_display));
- } else if (selection == &xwm->primary_selection) {
- wlr_seat_set_gtk_primary_selection(xwm->seat, NULL,
- wl_display_next_serial(xwm->xwayland->wl_display));
+ } else if (selection == &xwm->primary_selection &&
+ xwm->xwayland->gtk_primary_selection) {
+ wlr_gtk_primary_selection_device_manager_set_selection(
+ xwm->xwayland->gtk_primary_selection, xwm->seat, NULL);
} else if (selection == &xwm->dnd_selection) {
// TODO: DND
} else {
diff --git a/xwayland/selection/selection.c b/xwayland/selection/selection.c
index a29eeeae..db6246bf 100644
--- a/xwayland/selection/selection.c
+++ b/xwayland/selection/selection.c
@@ -228,11 +228,12 @@ void xwm_selection_finish(struct wlr_xwm *xwm) {
wlr_seat_set_selection(xwm->seat, NULL,
wl_display_next_serial(xwm->xwayland->wl_display));
}
- if (xwm->seat->primary_selection_source &&
+ if (xwm->xwayland->gtk_primary_selection &&
+ xwm->seat->primary_selection_source &&
primary_selection_source_is_xwayland(
xwm->seat->primary_selection_source)) {
- wlr_seat_set_gtk_primary_selection(xwm->seat, NULL,
- wl_display_next_serial(xwm->xwayland->wl_display));
+ wlr_gtk_primary_selection_device_manager_set_selection(
+ xwm->xwayland->gtk_primary_selection, xwm->seat, NULL);
}
wlr_xwayland_set_seat(xwm->xwayland, NULL);
}