Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package wlroots for openSUSE:Factory checked 
in at 2024-12-30 12:52:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wlroots (Old)
 and      /work/SRC/openSUSE:Factory/.wlroots.new.1881 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wlroots"

Mon Dec 30 12:52:05 2024 rev:35 rq:1233717 version:0.18.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/wlroots/wlroots.changes  2024-09-22 
11:06:45.942449786 +0200
+++ /work/SRC/openSUSE:Factory/.wlroots.new.1881/wlroots.changes        
2024-12-30 12:52:19.621588013 +0100
@@ -1,0 +2,19 @@
+Sun Dec 29 01:31:19 UTC 2024 - Soc Virnyl Estela 
<[email protected]>
+
+- Update to version 0.18.2:
+  * dnd: ensure internal dnd handlers are unlinked on xwm_destroy()
+  * xwayland: fix xdg->xwayland drag-and-drop
+  * backend/headless: actually perform output test
+  * backend/wayland: Account for shm buffer offset
+  * backend/drm: check whether clipped damage is empty
+  * output-management-v1: only create custom mode object for enabled heads
+  * backend/drm: check buffer format for multi-GPU
+  * backend/drm: fix drmModePageFlip() when disabling CRTC on legacy uAPI
+  * render/vulkan: fix crash on OOM
+  * xwayland: listen to drag focus destroy signal
+  * xwayland: remove loop to find drag focus surface
+  * data-device: reset focused surface when destroyed
+  * build: bump version to 0.18.2
+  * wlr_keyboard: don't emit key event for duplicated keycodes
+
+-------------------------------------------------------------------

Old:
----
  wlroots-0.18.1.tar.gz
  wlroots-0.18.1.tar.gz.sig

New:
----
  wlroots-0.18.2.tar.gz
  wlroots-0.18.2.tar.gz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ wlroots.spec ++++++
--- /var/tmp/diff_new_pack.fKxo6Y/_old  2024-12-30 12:52:20.273614775 +0100
+++ /var/tmp/diff_new_pack.fKxo6Y/_new  2024-12-30 12:52:20.277614940 +0100
@@ -18,6 +18,7 @@
 
 %global ver_suffix 0.18
 %global sover      0_18
+%global patch_ver  2
 %global libname libwlroots-%{sover}
 %bcond_without  drm_backend
 %bcond_without  libinput_backend
@@ -26,7 +27,7 @@
 %bcond_without  xcb_errors
 
 Name:           wlroots
-Version:        %{ver_suffix}.1
+Version:        %{ver_suffix}.%{patch_ver}
 Release:        0
 Summary:        Modular Wayland compositor library
 License:        MIT

++++++ wlroots-0.18.1.tar.gz -> wlroots-0.18.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/backend/drm/atomic.c 
new/wlroots-0.18.2/backend/drm/atomic.c
--- old/wlroots-0.18.1/backend/drm/atomic.c     2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/backend/drm/atomic.c     2024-12-11 23:59:09.000000000 
+0100
@@ -152,18 +152,20 @@
 
 bool create_fb_damage_clips_blob(struct wlr_drm_backend *drm,
                int width, int height, const pixman_region32_t *damage, 
uint32_t *blob_id) {
-       if (!pixman_region32_not_empty(damage)) {
-               *blob_id = 0;
-               return true;
-       }
-
        pixman_region32_t clipped;
        pixman_region32_init(&clipped);
        pixman_region32_intersect_rect(&clipped, damage, 0, 0, width, height);
 
        int rects_len;
        const pixman_box32_t *rects = pixman_region32_rectangles(&clipped, 
&rects_len);
-       int ret = drmModeCreatePropertyBlob(drm->fd, rects, sizeof(*rects) * 
rects_len, blob_id);
+
+       int ret;
+       if (rects_len > 0) {
+               ret = drmModeCreatePropertyBlob(drm->fd, rects, sizeof(*rects) 
* rects_len, blob_id);
+       } else {
+               ret = 0;
+               *blob_id = 0;
+       }
        pixman_region32_fini(&clipped);
        if (ret != 0) {
                wlr_log_errno(WLR_ERROR, "Failed to create FB_DAMAGE_CLIPS 
property blob");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/backend/drm/drm.c 
new/wlroots-0.18.2/backend/drm/drm.c
--- old/wlroots-0.18.1/backend/drm/drm.c        2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/backend/drm/drm.c        2024-12-11 23:59:09.000000000 
+0100
@@ -577,6 +577,16 @@
 
                conn->cursor_enabled = false;
                conn->crtc = NULL;
+
+               // Legacy uAPI doesn't support requesting page-flip events when
+               // turning off a CRTC
+               if (page_flip != NULL && conn->backend->iface == &legacy_iface) 
{
+                       drm_page_flip_pop(page_flip, crtc->id);
+                       conn->pending_page_flip = NULL;
+                       if (page_flip->connectors_len == 0) {
+                               drm_page_flip_destroy(page_flip);
+                       }
+               }
        }
 }
 
@@ -803,6 +813,22 @@
                return false;
        }
 
+       if ((state->committed & WLR_OUTPUT_STATE_BUFFER) && 
conn->backend->mgpu_renderer.wlr_rend) {
+               struct wlr_dmabuf_attributes dmabuf;
+               if (!wlr_buffer_get_dmabuf(state->buffer, &dmabuf)) {
+                       wlr_drm_conn_log(conn, WLR_DEBUG, "Buffer is not a 
DMA-BUF");
+                       return false;
+               }
+
+               if (!wlr_drm_format_set_has(&conn->backend->mgpu_formats, 
dmabuf.format, dmabuf.modifier)) {
+                       wlr_drm_conn_log(conn, WLR_DEBUG,
+                               "Buffer format 0x%"PRIX32" with modifier 
0x%"PRIX64" cannot be "
+                               "imported into multi-GPU renderer",
+                               dmabuf.format, dmabuf.modifier);
+                       return false;
+               }
+       }
+
        if (test_only && conn->backend->parent) {
                // If we're running as a secondary GPU, we can't perform an 
atomic
                // commit without blitting a buffer.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/backend/drm/legacy.c 
new/wlroots-0.18.2/backend/drm/legacy.c
--- old/wlroots-0.18.1/backend/drm/legacy.c     2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/backend/drm/legacy.c     2024-12-11 23:59:09.000000000 
+0100
@@ -128,7 +128,7 @@
                        state->base->adaptive_sync_enabled ? "enabled" : 
"disabled");
        }
 
-       if (cursor != NULL && drm_connector_is_cursor_visible(conn)) {
+       if (cursor != NULL && state->active && 
drm_connector_is_cursor_visible(conn)) {
                struct wlr_drm_fb *cursor_fb = state->cursor_fb;
                if (cursor_fb == NULL) {
                        wlr_drm_conn_log(conn, WLR_DEBUG, "Failed to acquire 
cursor FB");
@@ -170,7 +170,9 @@
                }
        }
 
-       if (flags & DRM_MODE_PAGE_FLIP_EVENT) {
+       // Legacy uAPI doesn't support requesting page-flip events when
+       // turning off a CRTC
+       if (state->active && (flags & DRM_MODE_PAGE_FLIP_EVENT)) {
                if (drmModePageFlip(drm->fd, crtc->id, fb_id, flags, 
page_flip)) {
                        wlr_drm_conn_log_errno(conn, WLR_ERROR, 
"drmModePageFlip failed");
                        return false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/backend/headless/output.c 
new/wlroots-0.18.2/backend/headless/output.c
--- old/wlroots-0.18.1/backend/headless/output.c        2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/backend/headless/output.c        2024-12-11 
23:59:09.000000000 +0100
@@ -89,6 +89,7 @@
 
 static const struct wlr_output_impl output_impl = {
        .destroy = output_destroy,
+       .test = output_test,
        .commit = output_commit,
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/backend/wayland/output.c 
new/wlroots-0.18.2/backend/wayland/output.c
--- old/wlroots-0.18.1/backend/wayland/output.c 2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/backend/wayland/output.c 2024-12-11 23:59:09.000000000 
+0100
@@ -198,7 +198,7 @@
                struct wlr_shm_attributes *shm) {
        enum wl_shm_format wl_shm_format = 
convert_drm_format_to_wl_shm(shm->format);
        uint32_t size = shm->stride * shm->height;
-       struct wl_shm_pool *pool = wl_shm_create_pool(wl->shm, shm->fd, size);
+       struct wl_shm_pool *pool = wl_shm_create_pool(wl->shm, shm->fd, 
shm->offset + size);
        if (pool == NULL) {
                return NULL;
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/include/types/wlr_keyboard.h 
new/wlroots-0.18.2/include/types/wlr_keyboard.h
--- old/wlroots-0.18.1/include/types/wlr_keyboard.h     2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/include/types/wlr_keyboard.h     2024-12-11 
23:59:09.000000000 +0100
@@ -1,6 +1,6 @@
 #include <wlr/types/wlr_keyboard.h>
 
-void keyboard_key_update(struct wlr_keyboard *keyboard,
+bool keyboard_key_update(struct wlr_keyboard *keyboard,
                struct wlr_keyboard_key_event *event);
 
 bool keyboard_modifier_update(struct wlr_keyboard *keyboard);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/include/wlr/types/wlr_data_device.h 
new/wlroots-0.18.2/include/wlr/types/wlr_data_device.h
--- old/wlroots-0.18.1/include/wlr/types/wlr_data_device.h      2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/include/wlr/types/wlr_data_device.h      2024-12-11 
23:59:09.000000000 +0100
@@ -126,6 +126,7 @@
 
        struct wl_listener source_destroy;
        struct wl_listener seat_client_destroy;
+       struct wl_listener focus_destroy;
        struct wl_listener icon_destroy;
 
        void *data;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/include/xwayland/xwm.h 
new/wlroots-0.18.2/include/xwayland/xwm.h
--- old/wlroots-0.18.1/include/xwayland/xwm.h   2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/include/xwayland/xwm.h   2024-12-11 23:59:09.000000000 
+0100
@@ -123,6 +123,7 @@
 
        struct wlr_drag *drag;
        struct wlr_xwayland_surface *drag_focus;
+       struct wlr_xwayland_surface *drop_focus;
 
        const xcb_query_extension_reply_t *xfixes;
        const xcb_query_extension_reply_t *xres;
@@ -144,6 +145,8 @@
        struct wl_listener seat_drag_drop;
        struct wl_listener seat_drag_destroy;
        struct wl_listener seat_drag_source_destroy;
+       struct wl_listener drag_focus_destroy;
+       struct wl_listener drop_focus_destroy;
 };
 
 struct wlr_xwm *xwm_create(struct wlr_xwayland *wlr_xwayland, int wm_fd);
@@ -156,6 +159,7 @@
 int xwm_handle_selection_event(struct wlr_xwm *xwm, xcb_generic_event_t 
*event);
 int xwm_handle_selection_client_message(struct wlr_xwm *xwm,
        xcb_client_message_event_t *ev);
+void xwm_seat_unlink_drag_handlers(struct wlr_xwm *xwm);
 
 void xwm_set_seat(struct wlr_xwm *xwm, struct wlr_seat *seat);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/meson.build 
new/wlroots-0.18.2/meson.build
--- old/wlroots-0.18.1/meson.build      2024-09-20 12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/meson.build      2024-12-11 23:59:09.000000000 +0100
@@ -1,7 +1,7 @@
 project(
        'wlroots',
        'c',
-       version: '0.18.1',
+       version: '0.18.2',
        license: 'MIT',
        meson_version: '>=0.59.0',
        default_options: [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/render/vulkan/renderer.c 
new/wlroots-0.18.2/render/vulkan/renderer.c
--- old/wlroots-0.18.1/render/vulkan/renderer.c 2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/render/vulkan/renderer.c 2024-12-11 23:59:09.000000000 
+0100
@@ -267,6 +267,8 @@
                goto error_alloc;
        }
 
+       wl_list_init(&buf->link);
+
        VkResult res;
        VkBufferCreateInfo buf_info = {
                .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/types/data_device/wlr_drag.c 
new/wlroots-0.18.2/types/data_device/wlr_drag.c
--- old/wlroots-0.18.1/types/data_device/wlr_drag.c     2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/types/data_device/wlr_drag.c     2024-12-11 
23:59:09.000000000 +0100
@@ -20,6 +20,14 @@
 }
 
 static void drag_set_focus(struct wlr_drag *drag,
+       struct wlr_surface *surface, double sx, double sy);
+
+static void drag_handle_focus_destroy(struct wl_listener *listener, void 
*data) {
+       struct wlr_drag *drag = wl_container_of(listener, drag, focus_destroy);
+       drag_set_focus(drag, NULL, 0, 0);
+}
+
+static void drag_set_focus(struct wlr_drag *drag,
                struct wlr_surface *surface, double sx, double sy) {
        if (drag->focus == surface) {
                return;
@@ -48,9 +56,12 @@
                }
 
                drag->focus_client = NULL;
-               drag->focus = NULL;
        }
 
+       wl_list_remove(&drag->focus_destroy.link);
+       wl_list_init(&drag->focus_destroy.link);
+       drag->focus = NULL;
+
        if (!surface) {
                goto out;
        }
@@ -99,6 +110,8 @@
 
        drag->focus = surface;
        drag->focus_client = focus_client;
+       drag->focus_destroy.notify = drag_handle_focus_destroy;
+       wl_signal_add(&surface->events.destroy, &drag->focus_destroy);
        drag->seat_client_destroy.notify = drag_handle_seat_client_destroy;
        wl_signal_add(&focus_client->events.destroy, 
&drag->seat_client_destroy);
 
@@ -150,6 +163,7 @@
        if (drag->source) {
                wl_list_remove(&drag->source_destroy.link);
        }
+       wl_list_remove(&drag->focus_destroy.link);
 
        if (drag->icon != NULL) {
                drag_icon_destroy(drag->icon);
@@ -410,6 +424,8 @@
        wl_signal_init(&drag->events.drop);
        wl_signal_init(&drag->events.destroy);
 
+       wl_list_init(&drag->focus_destroy.link);
+
        drag->seat = seat_client->seat;
        drag->seat_client = seat_client;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/types/wlr_keyboard.c 
new/wlroots-0.18.2/types/wlr_keyboard.c
--- old/wlroots-0.18.1/types/wlr_keyboard.c     2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/types/wlr_keyboard.c     2024-12-11 23:59:09.000000000 
+0100
@@ -65,8 +65,9 @@
        return true;
 }
 
-void keyboard_key_update(struct wlr_keyboard *keyboard,
+bool keyboard_key_update(struct wlr_keyboard *keyboard,
                struct wlr_keyboard_key_event *event) {
+       size_t old_num_keycodes = keyboard->num_keycodes;
        if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
                set_add(keyboard->keycodes, &keyboard->num_keycodes,
                        WLR_KEYBOARD_KEYS_CAP, event->keycode);
@@ -77,6 +78,8 @@
        }
 
        assert(keyboard->num_keycodes <= WLR_KEYBOARD_KEYS_CAP);
+
+       return old_num_keycodes != keyboard->num_keycodes;
 }
 
 void wlr_keyboard_notify_modifiers(struct wlr_keyboard *keyboard,
@@ -98,8 +101,9 @@
 
 void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
                struct wlr_keyboard_key_event *event) {
-       keyboard_key_update(keyboard, event);
-       wl_signal_emit_mutable(&keyboard->events.key, event);
+       if (keyboard_key_update(keyboard, event)) {
+               wl_signal_emit_mutable(&keyboard->events.key, event);
+       }
 
        if (keyboard->xkb_state == NULL) {
                return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/types/wlr_output_management_v1.c 
new/wlroots-0.18.2/types/wlr_output_management_v1.c
--- old/wlroots-0.18.1/types/wlr_output_management_v1.c 2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/types/wlr_output_management_v1.c 2024-12-11 
23:59:09.000000000 +0100
@@ -867,7 +867,7 @@
                head_send_mode(head, head_resource, mode);
        }
 
-       if (output->current_mode == NULL) {
+       if (head->state.mode == NULL && head->state.enabled) {
                // Output doesn't have a fixed mode set. Send a virtual one.
                head_send_mode(head, head_resource, NULL);
        }
@@ -927,7 +927,7 @@
                }
        }
 
-       if (next->mode == NULL && !head_has_custom_mode_resources(head)) {
+       if (next->mode == NULL && next->enabled && 
!head_has_custom_mode_resources(head)) {
                struct wl_resource *resource;
                wl_resource_for_each(resource, &head->resources) {
                        head_send_mode(head, resource, NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/xwayland/selection/dnd.c 
new/wlroots-0.18.2/xwayland/selection/dnd.c
--- old/wlroots-0.18.1/xwayland/selection/dnd.c 2024-09-20 12:51:54.000000000 
+0200
+++ new/wlroots-0.18.2/xwayland/selection/dnd.c 2024-12-11 23:59:09.000000000 
+0100
@@ -212,10 +212,10 @@
                bool performed = data->data32[1] & 1;
                xcb_atom_t action_atom = data->data32[2];
 
-               if (xwm->drag_focus == NULL ||
-                               target_window != xwm->drag_focus->window_id) {
+               if (xwm->drop_focus == NULL ||
+                               target_window != xwm->drop_focus->window_id) {
                        wlr_log(WLR_DEBUG, "ignoring XdndFinished client 
message because "
-                               "it doesn't match the finished drag focus 
window ID");
+                               "it doesn't match the finished drop focus 
window ID");
                        return 1;
                }
 
@@ -234,39 +234,56 @@
        }
 }
 
-static void seat_handle_drag_focus(struct wl_listener *listener, void *data) {
-       struct wlr_drag *drag = data;
-       struct wlr_xwm *xwm = wl_container_of(listener, xwm, seat_drag_focus);
+static void xwm_set_drag_focus(struct wlr_xwm *xwm, struct 
wlr_xwayland_surface *focus);
 
-       struct wlr_xwayland_surface *focus = NULL;
-       if (drag->focus != NULL) {
-               // TODO: check for subsurfaces?
-               struct wlr_xwayland_surface *surface;
-               wl_list_for_each(surface, &xwm->surfaces, link) {
-                       if (surface->surface == drag->focus) {
-                               focus = surface;
-                               break;
-                       }
-               }
-       }
+static void drag_focus_handle_destroy(struct wl_listener *listener, void 
*data) {
+       struct wlr_xwm *xwm = wl_container_of(listener, xwm, 
drag_focus_destroy);
+       xwm_set_drag_focus(xwm, NULL);
+}
+
+static void drop_focus_handle_destroy(struct wl_listener *listener, void 
*data) {
+       struct wlr_xwm *xwm = wl_container_of(listener, xwm, 
drop_focus_destroy);
+       wl_list_remove(&xwm->drop_focus_destroy.link);
+       wl_list_init(&xwm->drop_focus_destroy.link);
+       xwm->drop_focus = NULL;
+}
 
+static void xwm_set_drag_focus(struct wlr_xwm *xwm, struct 
wlr_xwayland_surface *focus) {
        if (focus == xwm->drag_focus) {
                return;
        }
 
        if (xwm->drag_focus != NULL) {
-               wlr_data_source_dnd_action(drag->source,
+               wlr_data_source_dnd_action(xwm->drag->source,
                        WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE);
                xwm_dnd_send_leave(xwm);
        }
 
+       wl_list_remove(&xwm->drag_focus_destroy.link);
+       wl_list_init(&xwm->drag_focus_destroy.link);
+
        xwm->drag_focus = focus;
 
        if (xwm->drag_focus != NULL) {
+               xwm->drag_focus_destroy.notify = drag_focus_handle_destroy;
+               wl_signal_add(&xwm->drag_focus->events.destroy, 
&xwm->drag_focus_destroy);
+
                xwm_dnd_send_enter(xwm);
        }
 }
 
+static void seat_handle_drag_focus(struct wl_listener *listener, void *data) {
+       struct wlr_drag *drag = data;
+       struct wlr_xwm *xwm = wl_container_of(listener, xwm, seat_drag_focus);
+
+       struct wlr_xwayland_surface *focus = NULL;
+       if (drag->focus != NULL) {
+               focus = wlr_xwayland_surface_try_from_wlr_surface(drag->focus);
+       }
+
+       xwm_set_drag_focus(xwm, focus);
+}
+
 static void seat_handle_drag_motion(struct wl_listener *listener, void *data) {
        struct wlr_xwm *xwm = wl_container_of(listener, xwm, seat_drag_motion);
        struct wlr_drag_motion_event *event = data;
@@ -289,6 +306,12 @@
        }
 
        wlr_log(WLR_DEBUG, "Wayland drag dropped over an Xwayland window");
+
+       xwm->drop_focus = xwm->drag_focus;
+       xwm->drop_focus_destroy.notify = drop_focus_handle_destroy;
+       wl_list_remove(&xwm->drop_focus_destroy.link);
+       wl_signal_add(&xwm->drop_focus->events.destroy, 
&xwm->drop_focus_destroy);
+
        xwm_dnd_send_drop(xwm, event->time);
 }
 
@@ -315,12 +338,25 @@
                wl_container_of(listener, xwm, seat_drag_source_destroy);
 
        wl_list_remove(&xwm->seat_drag_source_destroy.link);
+       wl_list_init(&xwm->seat_drag_source_destroy.link);
+       wl_list_remove(&xwm->drag_focus_destroy.link);
+       wl_list_init(&xwm->drag_focus_destroy.link);
        xwm->drag_focus = NULL;
+
+       wl_list_remove(&xwm->drop_focus_destroy.link);
+       wl_list_init(&xwm->drop_focus_destroy.link);
+       xwm->drop_focus = NULL;
 }
 
 void xwm_seat_handle_start_drag(struct wlr_xwm *xwm, struct wlr_drag *drag) {
+       wl_list_remove(&xwm->drag_focus_destroy.link);
+       wl_list_init(&xwm->drag_focus_destroy.link);
+       wl_list_remove(&xwm->drop_focus_destroy.link);
+       wl_list_init(&xwm->drop_focus_destroy.link);
+
        xwm->drag = drag;
        xwm->drag_focus = NULL;
+       xwm->drop_focus = NULL;
 
        if (drag != NULL) {
                wl_signal_add(&drag->events.focus, &xwm->seat_drag_focus);
@@ -337,3 +373,17 @@
                xwm->seat_drag_source_destroy.notify = 
seat_handle_drag_source_destroy;
        }
 }
+
+void xwm_seat_unlink_drag_handlers(struct wlr_xwm *xwm) {
+       wl_list_remove(&xwm->seat_drag_source_destroy.link);
+       wl_list_remove(&xwm->drag_focus_destroy.link);
+       wl_list_remove(&xwm->drop_focus_destroy.link);
+
+       if (!xwm->drag) {
+               return;
+       }
+       wl_list_remove(&xwm->seat_drag_focus.link);
+       wl_list_remove(&xwm->seat_drag_motion.link);
+       wl_list_remove(&xwm->seat_drag_drop.link);
+       wl_list_remove(&xwm->seat_drag_destroy.link);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/xwayland/selection/outgoing.c 
new/wlroots-0.18.2/xwayland/selection/outgoing.c
--- old/wlroots-0.18.1/xwayland/selection/outgoing.c    2024-09-20 
12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/xwayland/selection/outgoing.c    2024-12-11 
23:59:09.000000000 +0100
@@ -410,8 +410,11 @@
                return;
        }
 
+       bool dnd_allowed = selection == &xwm->dnd_selection
+               && (xwm->drag_focus != NULL || xwm->drop_focus != NULL);
+
        // No xwayland surface focused, deny access to clipboard
-       if (xwm->focus_surface == NULL && xwm->drag_focus == NULL) {
+       if (xwm->focus_surface == NULL && !dnd_allowed) {
                if (wlr_log_get_verbosity() >= WLR_DEBUG) {
                        char *selection_name = xwm_get_atom_name(xwm, 
selection->atom);
                        wlr_log(WLR_DEBUG, "denying read access to selection %u 
(%s): "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.1/xwayland/xwm.c 
new/wlroots-0.18.2/xwayland/xwm.c
--- old/wlroots-0.18.1/xwayland/xwm.c   2024-09-20 12:51:54.000000000 +0200
+++ new/wlroots-0.18.2/xwayland/xwm.c   2024-12-11 23:59:09.000000000 +0100
@@ -1879,6 +1879,8 @@
        xwm_selection_finish(&xwm->primary_selection);
        xwm_selection_finish(&xwm->dnd_selection);
 
+       xwm_seat_unlink_drag_handlers(xwm);
+
        if (xwm->seat) {
                if (xwm->seat->selection_source &&
                                
data_source_is_xwayland(xwm->seat->selection_source)) {
@@ -2173,6 +2175,10 @@
        wl_list_init(&xwm->surfaces_in_stack_order);
        wl_list_init(&xwm->unpaired_surfaces);
        wl_list_init(&xwm->pending_startup_ids);
+       wl_list_init(&xwm->seat_drag_source_destroy.link);
+       wl_list_init(&xwm->drag_focus_destroy.link);
+       wl_list_init(&xwm->drop_focus_destroy.link);
+
        xwm->ping_timeout = 10000;
 
        xwm->xcb_conn = xcb_connect_to_fd(wm_fd, NULL);

Reply via email to