summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2024-02-28 17:25:13 +0100
committersfan5 <sfan5@live.de>2024-02-29 17:24:05 +0100
commit878b76f75ea2f9f3177dc064187e91217922c7cc (patch)
treee9524eeee2ca444abb88d5dc0d7fcf7a02839636
parent78cedac844c8b3accef9bc6bd5a24474e7f9d19a (diff)
downloadmpv-878b76f75ea2f9f3177dc064187e91217922c7cc.tar.bz2
mpv-878b76f75ea2f9f3177dc064187e91217922c7cc.tar.xz
wayland_common: fix initialization order issue with protocols
This broke DND under (apparently) GNOME and KWin, but not sway. fixes: 2274311b259b7b03e3764ab4c21d69988b70a337
-rw-r--r--video/out/wayland_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 3c07ee79ee..78ce86ca74 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1474,10 +1474,6 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id
seat->id = id;
seat->seat = wl_registry_bind(reg, id, &wl_seat_interface, ver);
wl_seat_add_listener(seat->seat, &seat_listener, seat);
- if (wl->dnd_devman) {
- seat->dnd_ddev = wl_data_device_manager_get_data_device(wl->dnd_devman, seat->seat);
- wl_data_device_add_listener(seat->dnd_ddev, &data_device_listener, seat);
- }
wl_list_insert(&wl->seat_list, &seat->link);
}
@@ -2490,7 +2486,13 @@ bool vo_wayland_init(struct vo *vo)
}
#endif
- if (!wl->dnd_devman) {
+ if (wl->dnd_devman) {
+ struct vo_wayland_seat *seat;
+ wl_list_for_each(seat, &wl->seat_list, link) {
+ seat->dnd_ddev = wl_data_device_manager_get_data_device(wl->dnd_devman, seat->seat);
+ wl_data_device_add_listener(seat->dnd_ddev, &data_device_listener, seat);
+ }
+ } else {
MP_VERBOSE(wl, "Compositor doesn't support the %s (ver. 3) protocol!\n",
wl_data_device_manager_interface.name);
}