mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
primary-selection: add a serial argument
The serial needs to be bumped when X11 clients set the selection, otherwise some Wayland clients (e.g. GTK) will overwrite it when they gain focus.
This commit is contained in:
parent
b619ab4d34
commit
06467d2e12
9 changed files with 32 additions and 19 deletions
|
|
@ -370,7 +370,8 @@ 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_primary_selection(xwm->seat, &source->base);
|
||||
wlr_seat_set_primary_selection(xwm->seat, &source->base,
|
||||
wl_display_next_serial(xwm->xwayland->wl_display));
|
||||
} else {
|
||||
wlr_primary_selection_source_destroy(&source->base);
|
||||
}
|
||||
|
|
@ -427,7 +428,8 @@ int xwm_handle_xfixes_selection_notify(struct wlr_xwm *xwm,
|
|||
wlr_seat_set_selection(xwm->seat, NULL,
|
||||
wl_display_next_serial(xwm->xwayland->wl_display));
|
||||
} else if (selection == &xwm->primary_selection) {
|
||||
wlr_seat_set_primary_selection(xwm->seat, NULL);
|
||||
wlr_seat_set_primary_selection(xwm->seat, NULL,
|
||||
wl_display_next_serial(xwm->xwayland->wl_display));
|
||||
} else if (selection == &xwm->dnd_selection) {
|
||||
// TODO: DND
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue