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-09-22 11:06:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/wlroots (Old)
 and      /work/SRC/openSUSE:Factory/.wlroots.new.29891 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "wlroots"

Sun Sep 22 11:06:22 2024 rev:34 rq:1202330 version:0.18.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/wlroots/wlroots.changes  2024-08-02 
17:26:23.070946984 +0200
+++ /work/SRC/openSUSE:Factory/.wlroots.new.29891/wlroots.changes       
2024-09-22 11:06:45.942449786 +0200
@@ -1,0 +2,31 @@
+Sat Sep 21 12:58:00 UTC 2024 - Soc Virnyl Estela <o...@uncomfyhalomacro.pl>
+
+- Update to version 0.18.1:
+  * wlr_scene: Force blend mode to PREMULTIPLIED if calculate visibility is 
disabled
+  * wlr_scene: Funnel all damage operations through scene_output_damage
+  * wlr_scene: Immediately apply pending output commit damage
+  * wlr_scene: Inline output_state_apply_damage
+  * wlr_scene: Don't special case swapchain buffers
+  * wlr_scene: Fix WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT when output is transformed
+  * ext-foreign-toplevel-list: use correct interface and add missing handler
+  * backend/drm: fix a use-after-free
+  * wlr_output: remove dead function
+  * docs: update comments for wlr_output API changes
+  * backend/drm: don't set vsync present flag if page flip was async
+  * output-power-management: send zwlr_output_power_v1.failed on output destroy
+  * xdg-popup: don't set a role resource destroy handler
+  * pointer-constraints: don't init/finish current/pending states
+  * linux-drm-syncobj: add missing decls in the header
+  * backend/wayland: process initial events from globals correctly
+  * scene: update output geom on commit after dropping pending damage
+  * scene: resize damage ring on geometry update
+  * linux-drm-syncobj-v1: actually use the requested version
+  * backend/drm: use CRTCs in-order
+  * render/vulkan: use non-coherent memory for read_pixels()
+  * build: bump version to 0.18.1
+  * render/vulkan: Fix draw rect clip region invalid in blend none mod
+  * Fix memory leak in drm.c
+  * Fix memory leak in xwayland.c
+  * xwayland/xwm: listen shell destroy signal
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ wlroots.spec ++++++
--- /var/tmp/diff_new_pack.H5lkJ7/_old  2024-09-22 11:06:46.438470273 +0200
+++ /var/tmp/diff_new_pack.H5lkJ7/_new  2024-09-22 11:06:46.442470438 +0200
@@ -26,7 +26,7 @@
 %bcond_without  xcb_errors
 
 Name:           wlroots
-Version:        %{ver_suffix}.0
+Version:        %{ver_suffix}.1
 Release:        0
 Summary:        Modular Wayland compositor library
 License:        MIT

++++++ wlroots-0.18.0.tar.gz -> wlroots-0.18.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/.builds/freebsd.yml 
new/wlroots-0.18.1/.builds/freebsd.yml
--- old/wlroots-0.18.0/.builds/freebsd.yml      2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/.builds/freebsd.yml      2024-09-20 12:51:54.000000000 
+0200
@@ -20,7 +20,7 @@
   - x11/xcb-util-errors
   - x11/xcb-util-renderutil
   - x11/xcb-util-wm
-  - x11-servers/xwayland-devel
+  - x11-servers/xwayland
   - sysutils/libdisplay-info
   - sysutils/seatd
   - gmake
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/backend/drm/drm.c 
new/wlroots-0.18.1/backend/drm/drm.c
--- old/wlroots-0.18.0/backend/drm/drm.c        2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/backend/drm/drm.c        2024-09-20 12:51:54.000000000 
+0200
@@ -396,6 +396,7 @@
                struct wlr_drm_plane *plane = &drm->planes[i];
                drm_plane_finish_surface(plane);
                wlr_drm_format_set_finish(&plane->formats);
+               free(plane->cursor_sizes);
        }
 
        free(drm->planes);
@@ -607,6 +608,7 @@
                if (page_flip == NULL) {
                        return false;
                }
+               page_flip->async = (flags & DRM_MODE_PAGE_FLIP_ASYNC);
        }
 
        bool ok = drm->iface->commit(drm, state, page_flip, flags, test_only);
@@ -2008,6 +2010,12 @@
        if (conn != NULL) {
                conn->pending_page_flip = NULL;
        }
+
+       uint32_t present_flags = WLR_OUTPUT_PRESENT_HW_CLOCK | 
WLR_OUTPUT_PRESENT_HW_COMPLETION;
+       if (!page_flip->async) {
+               present_flags |= WLR_OUTPUT_PRESENT_VSYNC;
+       }
+
        if (page_flip->connectors_len == 0) {
                drm_page_flip_destroy(page_flip);
        }
@@ -2038,8 +2046,6 @@
                drm_fb_move(&layer->current_fb, &layer->queued_fb);
        }
 
-       uint32_t present_flags = WLR_OUTPUT_PRESENT_VSYNC |
-               WLR_OUTPUT_PRESENT_HW_CLOCK | WLR_OUTPUT_PRESENT_HW_COMPLETION;
        /* Don't report ZERO_COPY in multi-gpu situations, because we had to 
copy
         * data between the GPUs, even if we were using the direct scanout
         * interface.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/backend/drm/util.c 
new/wlroots-0.18.1/backend/drm/util.c
--- old/wlroots-0.18.0/backend/drm/util.c       2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/backend/drm/util.c       2024-09-20 12:51:54.000000000 
+0200
@@ -170,12 +170,6 @@
                        has_best = true;
                }
        }
-       if (st->orig[i] == UNMATCHED) {
-               st->res[i] = UNMATCHED;
-               if (match_obj_(st, skips, score, replaced, i + 1)) {
-                       has_best = true;
-               }
-       }
        if (st->exit_early) {
                return true;
        }
@@ -211,13 +205,13 @@
                }
        }
 
-       if (has_best) {
-               return true;
-       }
-
        // Maybe this resource can't be matched
        st->res[i] = UNMATCHED;
-       return match_obj_(st, skips, score, replaced, i + 1);
+       if (match_obj_(st, skips, score, replaced, i + 1)) {
+               has_best = true;
+       }
+
+       return has_best;
 }
 
 size_t match_obj(size_t num_objs, const uint32_t objs[static restrict 
num_objs],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/backend/wayland/backend.c 
new/wlroots-0.18.1/backend/wayland/backend.c
--- old/wlroots-0.18.0/backend/wayland/backend.c        2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/backend/wayland/backend.c        2024-09-20 
12:51:54.000000000 +0200
@@ -178,7 +178,9 @@
                        "falling back to primary node", name);
        }
 
-       feedback_data->backend->drm_render_name = strdup(name);
+       struct wlr_wl_backend *wl = feedback_data->backend;
+       assert(wl->drm_render_name == NULL);
+       wl->drm_render_name = strdup(name);
 
        drmFreeDevice(&device);
 }
@@ -305,6 +307,7 @@
 static void legacy_drm_handle_device(void *data, struct wl_drm *drm,
                const char *name) {
        struct wlr_wl_backend *wl = data;
+       assert(wl->drm_render_name == NULL);
        wl->drm_render_name = get_render_name(name);
 }
 
@@ -621,6 +624,8 @@
                goto error_registry;
        }
 
+       wl_display_roundtrip(wl->remote_display); // process initial event 
bursts
+
        struct zwp_linux_dmabuf_feedback_v1 *linux_dmabuf_feedback_v1 = NULL;
        struct wlr_wl_linux_dmabuf_feedback_v1 feedback_data = { .backend = wl 
};
        if (wl->zwp_linux_dmabuf_v1 != NULL &&
@@ -638,15 +643,17 @@
                if (wl->legacy_drm != NULL) {
                        wl_drm_destroy(wl->legacy_drm);
                        wl->legacy_drm = NULL;
+
+                       free(wl->drm_render_name);
+                       wl->drm_render_name = NULL;
                }
-       }
 
-       wl_display_roundtrip(wl->remote_display); // get linux-dmabuf formats
+               wl_display_roundtrip(wl->remote_display); // get linux-dmabuf 
feedback events
+
+               if (feedback_data.format_table != NULL) {
+                       munmap(feedback_data.format_table, 
feedback_data.format_table_size);
+               }
 
-       if (feedback_data.format_table != NULL) {
-               munmap(feedback_data.format_table, 
feedback_data.format_table_size);
-       }
-       if (linux_dmabuf_feedback_v1 != NULL) {
                zwp_linux_dmabuf_feedback_v1_destroy(linux_dmabuf_feedback_v1);
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/examples/output-layers.c 
new/wlroots-0.18.1/examples/output-layers.c
--- old/wlroots-0.18.0/examples/output-layers.c 2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/examples/output-layers.c 2024-09-20 12:51:54.000000000 
+0200
@@ -87,7 +87,7 @@
                layers_arr.size / sizeof(struct wlr_output_layer_state));
 
        if (!wlr_output_test_state(output->wlr_output, &output_state)) {
-               wlr_log(WLR_ERROR, "wlr_output_test() failed");
+               wlr_log(WLR_ERROR, "wlr_output_test_state() failed");
                return;
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/include/backend/drm/drm.h 
new/wlroots-0.18.1/include/backend/drm/drm.h
--- old/wlroots-0.18.0/include/backend/drm/drm.h        2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/include/backend/drm/drm.h        2024-09-20 
12:51:54.000000000 +0200
@@ -164,6 +164,8 @@
        struct wl_list link; // wlr_drm_connector.page_flips
        struct wlr_drm_page_flip_connector *connectors;
        size_t connectors_len;
+       // True if DRM_MODE_PAGE_FLIP_ASYNC was set
+       bool async;
 };
 
 struct wlr_drm_page_flip_connector {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wlroots-0.18.0/include/wlr/types/wlr_linux_drm_syncobj_v1.h 
new/wlroots-0.18.1/include/wlr/types/wlr_linux_drm_syncobj_v1.h
--- old/wlroots-0.18.0/include/wlr/types/wlr_linux_drm_syncobj_v1.h     
2024-07-12 23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/include/wlr/types/wlr_linux_drm_syncobj_v1.h     
2024-09-20 12:51:54.000000000 +0200
@@ -12,6 +12,9 @@
 #include <wayland-server-core.h>
 #include <wlr/util/addon.h>
 
+struct wlr_buffer;
+struct wlr_surface;
+
 struct wlr_linux_drm_syncobj_surface_v1_state {
        struct wlr_drm_syncobj_timeline *acquire_timeline;
        uint64_t acquire_point;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/include/wlr/types/wlr_output.h 
new/wlroots-0.18.1/include/wlr/types/wlr_output.h
--- old/wlroots-0.18.0/include/wlr/types/wlr_output.h   2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/include/wlr/types/wlr_output.h   2024-09-20 
12:51:54.000000000 +0200
@@ -121,8 +121,9 @@
  * The `frame` event will be emitted when it is a good time for the compositor
  * to submit a new frame.
  *
- * To render a new frame, compositors should call 
wlr_output_begin_render_pass(),
- * perform rendering on that render pass and finally call wlr_output_commit().
+ * To render a new frame compositors should call 
wlr_output_begin_render_pass(),
+ * perform rendering on that render pass, and finally call
+ * wlr_output_commit_state().
  */
 struct wlr_output {
        const struct wlr_output_impl *impl;
@@ -280,7 +281,7 @@
  * the allocator and renderer to different values.
  *
  * Call this function prior to any call to wlr_output_begin_render_pass(),
- * wlr_output_commit() or wlr_output_cursor_create().
+ * wlr_output_commit_state() or wlr_output_cursor_create().
  *
  * The buffer capabilities of the provided must match the capabilities of the
  * output's backend. Returns false otherwise.
@@ -370,12 +371,6 @@
  */
 void wlr_output_lock_software_cursors(struct wlr_output *output, bool lock);
 /**
- * Renders software cursors. This is a utility function that can be called when
- * compositors render.
- */
-void wlr_output_render_software_cursors(struct wlr_output *output,
-       const pixman_region32_t *damage);
-/**
  * Render software cursors.
  *
  * This is a utility function that can be called when compositors render.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/include/wlr/types/wlr_output_layer.h 
new/wlroots-0.18.1/include/wlr/types/wlr_output_layer.h
--- old/wlroots-0.18.0/include/wlr/types/wlr_output_layer.h     2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/include/wlr/types/wlr_output_layer.h     2024-09-20 
12:51:54.000000000 +0200
@@ -23,16 +23,16 @@
  *
  * To configure output layers, callers should call wlr_output_layer_create() to
  * create layers, attach struct wlr_output_layer_state onto
- * struct wlr_output_state via wlr_output_set_layers() to describe their new
- * state, and commit the output via wlr_output_commit().
+ * struct wlr_output_state via wlr_output_state_set_layers() to describe their 
new
+ * state, and commit the output via wlr_output_commit_state().
  *
  * Backends may have arbitrary limitations when it comes to displaying output
  * layers. Backends indicate whether or not a layer can be displayed via
- * wlr_output_layer_state.accepted after wlr_output_test() or
- * wlr_output_commit() is called. Compositors using the output layers API
- * directly are expected to setup layers, call wlr_output_test(), paint the
- * layers that the backend rejected with the renderer, then call
- * wlr_output_commit().
+ * wlr_output_layer_state.accepted after wlr_output_test_state() or
+ * wlr_output_commit_state() is called. Compositors using the output layers API
+ * directly are expected to setup layers, call wlr_output_test_state(), paint
+ * the layers that the backend rejected with the renderer, then call
+ * wlr_output_commit_state().
  *
  * Callers are responsible for disabling output layers when they need the full
  * output contents to be composited onto a single buffer, e.g. during screen
@@ -72,9 +72,9 @@
        // to damage the whole buffer.
        const pixman_region32_t *damage;
 
-       // Populated by the backend after wlr_output_test() and 
wlr_output_commit(),
-       // indicates whether the backend has acknowledged and will take care of
-       // displaying the layer
+       // Populated by the backend after wlr_output_test_state() and
+       // wlr_output_commit_state(), indicates whether the backend has 
acknowledged
+       // and will take care of displaying the layer
        bool accepted;
 };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wlroots-0.18.0/include/wlr/types/wlr_presentation_time.h 
new/wlroots-0.18.1/include/wlr/types/wlr_presentation_time.h
--- old/wlroots-0.18.0/include/wlr/types/wlr_presentation_time.h        
2024-07-12 23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/include/wlr/types/wlr_presentation_time.h        
2024-09-20 12:51:54.000000000 +0200
@@ -89,7 +89,7 @@
  *
  * Instead of calling wlr_presentation_surface_sampled() and managing the
  * struct wlr_presentation_feedback itself, the compositor can call this 
function
- * before a wlr_output_commit() call to indicate that the surface's current
+ * before a wlr_output_commit_state() call to indicate that the surface's 
current
  * contents have been copied to a buffer which will be displayed on the output.
  */
 void wlr_presentation_surface_textured_on_output(struct wlr_surface *surface,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/include/xwayland/xwm.h 
new/wlroots-0.18.1/include/xwayland/xwm.h
--- old/wlroots-0.18.0/include/xwayland/xwm.h   2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/include/xwayland/xwm.h   2024-09-20 12:51:54.000000000 
+0200
@@ -135,6 +135,7 @@
        struct wl_listener compositor_new_surface;
        struct wl_listener compositor_destroy;
        struct wl_listener shell_v1_new_surface;
+       struct wl_listener shell_v1_destroy;
        struct wl_listener seat_set_selection;
        struct wl_listener seat_set_primary_selection;
        struct wl_listener seat_start_drag;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/meson.build 
new/wlroots-0.18.1/meson.build
--- old/wlroots-0.18.0/meson.build      2024-07-12 23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/meson.build      2024-09-20 12:51:54.000000000 +0200
@@ -1,7 +1,7 @@
 project(
        'wlroots',
        'c',
-       version: '0.18.0',
+       version: '0.18.1',
        license: 'MIT',
        meson_version: '>=0.59.0',
        default_options: [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/render/vulkan/pass.c 
new/wlroots-0.18.1/render/vulkan/pass.c
--- old/wlroots-0.18.0/render/vulkan/pass.c     2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/render/vulkan/pass.c     2024-09-20 12:51:54.000000000 
+0200
@@ -572,16 +572,10 @@
                        },
                };
                VkClearRect clear_rect = {
-                       .rect = {
-                               .offset = { box.x, box.y },
-                               .extent = { box.width, box.height },
-                       },
                        .layerCount = 1,
                };
                for (int i = 0; i < clip_rects_len; i++) {
-                       VkRect2D rect;
-                       convert_pixman_box_to_vk_rect(&clip_rects[i], &rect);
-                       vkCmdSetScissor(cb, 0, 1, &rect);
+                       convert_pixman_box_to_vk_rect(&clip_rects[i], 
&clear_rect.rect);
                        vkCmdClearAttachments(cb, 1, &clear_att, 1, 
&clear_rect);
                }
                break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/render/vulkan/renderer.c 
new/wlroots-0.18.1/render/vulkan/renderer.c
--- old/wlroots-0.18.0/render/vulkan/renderer.c 2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/render/vulkan/renderer.c 2024-09-20 12:51:54.000000000 
+0200
@@ -1224,7 +1224,6 @@
 
                int mem_type = vulkan_find_mem_type(vk_renderer->dev,
                                VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
-                               VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
                                VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
                                mem_reqs.memoryTypeBits);
                if (mem_type < 0) {
@@ -1361,6 +1360,19 @@
                return false;
        }
 
+       VkMappedMemoryRange mem_range = {
+               .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
+               .memory = dst_img_memory,
+               .offset = 0,
+               .size = VK_WHOLE_SIZE,
+       };
+       res = vkInvalidateMappedMemoryRanges(dev, 1, &mem_range);
+       if (res != VK_SUCCESS) {
+               wlr_vk_error("vkInvalidateMappedMemoryRanges", res);
+               vkUnmapMemory(dev, dst_img_memory);
+               return false;
+       }
+
        const char *d = (const char *)v + img_sub_layout.offset;
        unsigned char *p = (unsigned char *)data + dst_y * stride;
        uint32_t bytes_per_pixel = pixel_format_info->bytes_per_block;
@@ -1376,6 +1388,7 @@
        vkUnmapMemory(dev, dst_img_memory);
        // Don't need to free anything else, since memory and image are cached
        return true;
+
 free_memory:
        vkFreeMemory(dev, dst_img_memory, NULL);
 destroy_image:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/types/scene/wlr_scene.c 
new/wlroots-0.18.1/types/scene/wlr_scene.c
--- old/wlroots-0.18.0/types/scene/wlr_scene.c  2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/types/scene/wlr_scene.c  2024-09-20 12:51:54.000000000 
+0200
@@ -315,6 +315,43 @@
        wlr_box_transform(box, box, transform, data->trans_width, 
data->trans_height);
 }
 
+static void scene_output_damage(struct wlr_scene_output *scene_output,
+               const pixman_region32_t *region) {
+       if (wlr_damage_ring_add(&scene_output->damage_ring, region)) {
+               wlr_output_schedule_frame(scene_output->output);
+
+               struct wlr_output *output = scene_output->output;
+               enum wl_output_transform transform =
+                       
wlr_output_transform_invert(scene_output->output->transform);
+
+               int width = output->width;
+               int height = output->height;
+               if (transform & WL_OUTPUT_TRANSFORM_90) {
+                       width = output->height;
+                       height = output->width;
+               }
+
+               pixman_region32_t frame_damage;
+               pixman_region32_init(&frame_damage);
+               wlr_region_transform(&frame_damage, region, transform, width, 
height);
+
+               pixman_region32_union(&scene_output->pending_commit_damage,
+                       &scene_output->pending_commit_damage, &frame_damage);
+               
pixman_region32_intersect_rect(&scene_output->pending_commit_damage,
+                       &scene_output->pending_commit_damage, 0, 0, 
output->width, output->height);
+               pixman_region32_fini(&frame_damage);
+       }
+}
+
+static void scene_output_damage_whole(struct wlr_scene_output *scene_output) {
+       struct wlr_damage_ring *ring = &scene_output->damage_ring;
+
+       pixman_region32_t damage;
+       pixman_region32_init_rect(&damage, 0, 0, ring->width, ring->height);
+       scene_output_damage(scene_output, &damage);
+       pixman_region32_fini(&damage);
+}
+
 static void scene_damage_outputs(struct wlr_scene *scene, pixman_region32_t 
*damage) {
        if (!pixman_region32_not_empty(damage)) {
                return;
@@ -328,9 +365,7 @@
                pixman_region32_translate(&output_damage,
                        -scene_output->x, -scene_output->y);
                scale_output_damage(&output_damage, 
scene_output->output->scale);
-               if (wlr_damage_ring_add(&scene_output->damage_ring, 
&output_damage)) {
-                       wlr_output_schedule_frame(scene_output->output);
-               }
+               scene_output_damage(scene_output, &output_damage);
                pixman_region32_fini(&output_damage);
        }
 }
@@ -800,9 +835,7 @@
                pixman_region32_translate(&output_damage,
                        (int)round((lx - scene_output->x) * output_scale),
                        (int)round((ly - scene_output->y) * output_scale));
-               if (wlr_damage_ring_add(&scene_output->damage_ring, 
&output_damage)) {
-                       wlr_output_schedule_frame(scene_output->output);
-               }
+               scene_output_damage(scene_output, &output_damage);
                pixman_region32_fini(&output_damage);
        }
 
@@ -1226,7 +1259,7 @@
                struct wlr_texture *texture = 
scene_buffer_get_texture(scene_buffer,
                        data->output->output->renderer);
                if (texture == NULL) {
-                       wlr_damage_ring_add(&data->output->damage_ring, 
&render_region);
+                       scene_output_damage(data->output, &render_region);
                        break;
                }
 
@@ -1242,7 +1275,8 @@
                        .clip = &render_region,
                        .alpha = &scene_buffer->opacity,
                        .filter_mode = scene_buffer->filter_mode,
-                       .blend_mode = pixman_region32_not_empty(&opaque) ?
+                       .blend_mode = 
!data->output->scene->calculate_visibility ||
+                                       pixman_region32_not_empty(&opaque) ?
                                WLR_RENDER_BLEND_MODE_PREMULTIPLIED : 
WLR_RENDER_BLEND_MODE_NONE,
                });
 
@@ -1312,8 +1346,11 @@
 
 static void scene_output_update_geometry(struct wlr_scene_output *scene_output,
                bool force_update) {
-       wlr_damage_ring_add_whole(&scene_output->damage_ring);
-       wlr_output_schedule_frame(scene_output->output);
+       int ring_width, ring_height;
+       wlr_output_transformed_resolution(scene_output->output, &ring_width, 
&ring_height);
+       wlr_damage_ring_set_bounds(&scene_output->damage_ring, ring_width, 
ring_height);
+
+       scene_output_damage_whole(scene_output);
 
        scene_node_output_update(&scene_output->scene->tree.node,
                        &scene_output->scene->outputs, NULL, force_update ? 
scene_output : NULL);
@@ -1325,6 +1362,19 @@
        struct wlr_output_event_commit *event = data;
        const struct wlr_output_state *state = event->state;
 
+       // if the output has been committed with a certain damage, we know that 
region
+       // will be acknowledged by the backend so we don't need to keep track 
of it
+       // anymore
+       if (state->committed & WLR_OUTPUT_STATE_BUFFER) {
+               if (state->committed & WLR_OUTPUT_STATE_DAMAGE) {
+                       
pixman_region32_subtract(&scene_output->pending_commit_damage,
+                               &scene_output->pending_commit_damage, 
&state->damage);
+               } else {
+                       
pixman_region32_fini(&scene_output->pending_commit_damage);
+                       
pixman_region32_init(&scene_output->pending_commit_damage);
+               }
+       }
+
        bool force_update = state->committed & (
                WLR_OUTPUT_STATE_TRANSFORM |
                WLR_OUTPUT_STATE_SCALE |
@@ -1335,28 +1385,6 @@
                scene_output_update_geometry(scene_output, force_update);
        }
 
-       // if the output has been committed with a certain damage, we know that 
region
-       // will be acknowledged by the backend so we don't need to keep track 
of it
-       // anymore
-       if (state->committed & WLR_OUTPUT_STATE_DAMAGE) {
-               bool tracking_buffer = false;
-               struct wlr_damage_ring_buffer *buffer;
-               wl_list_for_each(buffer, &scene_output->damage_ring.buffers, 
link) {
-                       if (buffer->buffer == state->buffer) {
-                               tracking_buffer = true;
-                               break;
-                       }
-               }
-
-               if (tracking_buffer) {
-                       
pixman_region32_subtract(&scene_output->pending_commit_damage,
-                               &scene_output->pending_commit_damage, 
&state->damage);
-               } else {
-                       
pixman_region32_union(&scene_output->pending_commit_damage,
-                               &scene_output->pending_commit_damage, 
&state->damage);
-               }
-       }
-
        if (scene_output->scene->debug_damage_option == 
WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT &&
                        
!wl_list_empty(&scene_output->damage_highlight_regions)) {
                wlr_output_schedule_frame(scene_output->output);
@@ -1367,9 +1395,7 @@
        struct wlr_scene_output *scene_output = wl_container_of(listener,
                scene_output, output_damage);
        struct wlr_output_event_damage *event = data;
-       if (wlr_damage_ring_add(&scene_output->damage_ring, event->damage)) {
-               wlr_output_schedule_frame(scene_output->output);
-       }
+       scene_output_damage(scene_output, event->damage);
 }
 
 static void scene_output_handle_needs_frame(struct wl_listener *listener, void 
*data) {
@@ -1556,21 +1582,6 @@
        return false;
 }
 
-static void output_state_apply_damage(const struct render_data *data,
-               struct wlr_output_state *state) {
-       struct wlr_scene_output *output = data->output;
-
-       pixman_region32_t frame_damage;
-       pixman_region32_init(&frame_damage);
-       pixman_region32_copy(&frame_damage, &output->damage_ring.current);
-       transform_output_damage(&frame_damage, data);
-       pixman_region32_union(&output->pending_commit_damage,
-               &output->pending_commit_damage, &frame_damage);
-       pixman_region32_fini(&frame_damage);
-
-       wlr_output_state_set_damage(state, &output->pending_commit_damage);
-}
-
 static void scene_buffer_send_dmabuf_feedback(const struct wlr_scene *scene,
                struct wlr_scene_buffer *scene_buffer,
                const struct wlr_linux_dmabuf_feedback_v1_init_options 
*options) {
@@ -1749,7 +1760,7 @@
 
        if (state->committed & WLR_OUTPUT_STATE_TRANSFORM) {
                if (render_data.transform != state->transform) {
-                       wlr_damage_ring_add_whole(&scene_output->damage_ring);
+                       scene_output_damage_whole(scene_output);
                }
 
                render_data.transform = state->transform;
@@ -1757,7 +1768,7 @@
 
        if (state->committed & WLR_OUTPUT_STATE_SCALE) {
                if (render_data.scale != state->scale) {
-                       wlr_damage_ring_add_whole(&scene_output->damage_ring);
+                       scene_output_damage_whole(scene_output);
                }
 
                render_data.scale = state->scale;
@@ -1791,7 +1802,7 @@
                render_data.trans_width, render_data.trans_height);
 
        if (debug_damage == WLR_SCENE_DEBUG_DAMAGE_RERENDER) {
-               wlr_damage_ring_add_whole(&scene_output->damage_ring);
+               scene_output_damage_whole(scene_output);
        }
 
        struct timespec now;
@@ -1828,11 +1839,11 @@
                        }
                }
 
-               wlr_damage_ring_add(&scene_output->damage_ring, &acc_damage);
+               scene_output_damage(scene_output, &acc_damage);
                pixman_region32_fini(&acc_damage);
        }
 
-       output_state_apply_damage(&render_data, state);
+       wlr_output_state_set_damage(state, 
&scene_output->pending_commit_damage);
 
        // We only want to try direct scanout if:
        // - There is only one entry in the render list
@@ -1969,11 +1980,18 @@
                        int64_t time_diff_ms = timespec_to_msec(&time_diff);
                        float alpha = 1.0 - (double)time_diff_ms / 
HIGHLIGHT_DAMAGE_FADEOUT_TIME;
 
+                       pixman_region32_t clip;
+                       pixman_region32_init(&clip);
+                       pixman_region32_copy(&clip, &damage->region);
+                       transform_output_damage(&clip, &render_data);
+
                        wlr_render_pass_add_rect(render_pass, &(struct 
wlr_render_rect_options){
                                .box = { .width = buffer->width, .height = 
buffer->height },
                                .color = { .r = alpha * 0.5, .g = 0, .b = 0, .a 
= alpha * 0.5 },
-                               .clip = &damage->region,
+                               .clip = &clip,
                        });
+
+                       pixman_region32_fini(&clip);
                }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wlroots-0.18.0/types/wlr_ext_foreign_toplevel_list_v1.c 
new/wlroots-0.18.1/types/wlr_ext_foreign_toplevel_list_v1.c
--- old/wlroots-0.18.0/types/wlr_ext_foreign_toplevel_list_v1.c 2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/types/wlr_ext_foreign_toplevel_list_v1.c 2024-09-20 
12:51:54.000000000 +0200
@@ -12,14 +12,18 @@
 
 #define FOREIGN_TOPLEVEL_LIST_V1_VERSION 1
 
-static const struct ext_foreign_toplevel_list_v1_interface 
toplevel_handle_impl;
+static const struct ext_foreign_toplevel_handle_v1_interface 
toplevel_handle_impl;
 
 static void foreign_toplevel_handle_destroy(struct wl_client *client,
                struct wl_resource *resource) {
+       assert(wl_resource_instance_of(resource,
+               &ext_foreign_toplevel_handle_v1_interface,
+               &toplevel_handle_impl));
+
        wl_resource_destroy(resource);
 }
 
-static const struct ext_foreign_toplevel_list_v1_interface 
toplevel_handle_impl = {
+static const struct ext_foreign_toplevel_handle_v1_interface 
toplevel_handle_impl = {
        .destroy = foreign_toplevel_handle_destroy,
 };
 
@@ -191,12 +195,23 @@
                &foreign_toplevel_list_impl));
 
        ext_foreign_toplevel_list_v1_send_finished(resource);
+       wl_list_remove(wl_resource_get_link(resource));
+       wl_list_init(wl_resource_get_link(resource));
+}
+
+static void foreign_toplevel_list_handle_destroy(struct wl_client *client,
+               struct wl_resource *resource) {
+       assert(wl_resource_instance_of(resource,
+               &ext_foreign_toplevel_list_v1_interface,
+               &foreign_toplevel_list_impl));
+
        wl_resource_destroy(resource);
 }
 
 static const struct ext_foreign_toplevel_list_v1_interface
                foreign_toplevel_list_impl = {
-       .stop = foreign_toplevel_list_handle_stop
+       .stop = foreign_toplevel_list_handle_stop,
+       .destroy = foreign_toplevel_list_handle_destroy
 };
 
 static void foreign_toplevel_list_resource_destroy(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/types/wlr_linux_drm_syncobj_v1.c 
new/wlroots-0.18.1/types/wlr_linux_drm_syncobj_v1.c
--- old/wlroots-0.18.0/types/wlr_linux_drm_syncobj_v1.c 2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/types/wlr_linux_drm_syncobj_v1.c 2024-09-20 
12:51:54.000000000 +0200
@@ -424,6 +424,8 @@
 
 struct wlr_linux_drm_syncobj_manager_v1 
*wlr_linux_drm_syncobj_manager_v1_create(
                struct wl_display *display, uint32_t version, int drm_fd) {
+       assert(version <= LINUX_DRM_SYNCOBJ_V1_VERSION);
+
        if (!check_syncobj_eventfd(drm_fd)) {
                wlr_log(WLR_INFO, "DRM syncobj eventfd unavailable, disabling 
linux-drm-syncobj-v1");
                return NULL;
@@ -441,7 +443,7 @@
 
        manager->global = wl_global_create(display,
                &wp_linux_drm_syncobj_manager_v1_interface,
-               LINUX_DRM_SYNCOBJ_V1_VERSION, manager, manager_bind);
+               version, manager, manager_bind);
        if (manager->global == NULL) {
                goto error_drm_fd;
        }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/wlroots-0.18.0/types/wlr_output_power_management_v1.c 
new/wlroots-0.18.1/types/wlr_output_power_management_v1.c
--- old/wlroots-0.18.0/types/wlr_output_power_management_v1.c   2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/types/wlr_output_power_management_v1.c   2024-09-20 
12:51:54.000000000 +0200
@@ -46,6 +46,7 @@
                void *data) {
        struct wlr_output_power_v1 *output_power =
                wl_container_of(listener, output_power, 
output_destroy_listener);
+       zwlr_output_power_v1_send_failed(output_power->resource);
        output_power_destroy(output_power);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/types/wlr_pointer_constraints_v1.c 
new/wlroots-0.18.1/types/wlr_pointer_constraints_v1.c
--- old/wlroots-0.18.0/types/wlr_pointer_constraints_v1.c       2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/types/wlr_pointer_constraints_v1.c       2024-09-20 
12:51:54.000000000 +0200
@@ -53,8 +53,6 @@
        wl_list_remove(&constraint->surface_commit.link);
        wl_list_remove(&constraint->surface_destroy.link);
        wl_list_remove(&constraint->seat_destroy.link);
-       pixman_region32_fini(&constraint->current.region);
-       pixman_region32_fini(&constraint->pending.region);
        pixman_region32_fini(&constraint->region);
        free(constraint);
 }
@@ -258,9 +256,6 @@
 
        pixman_region32_init(&constraint->region);
 
-       pixman_region32_init(&constraint->pending.region);
-       pixman_region32_init(&constraint->current.region);
-
        pointer_constraint_set_region(constraint, region_resource);
        pointer_constraint_commit(constraint);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/types/xdg_shell/wlr_xdg_popup.c 
new/wlroots-0.18.1/types/xdg_shell/wlr_xdg_popup.c
--- old/wlroots-0.18.0/types/xdg_shell/wlr_xdg_popup.c  2024-07-12 
23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/types/xdg_shell/wlr_xdg_popup.c  2024-09-20 
12:51:54.000000000 +0200
@@ -361,15 +361,6 @@
        .state_size = sizeof(struct wlr_xdg_popup_state),
 };
 
-static void xdg_popup_handle_resource_destroy(struct wl_resource *resource) {
-       struct wlr_xdg_popup *popup =
-               wlr_xdg_popup_from_resource(resource);
-       if (popup == NULL) {
-               return;
-       }
-       wlr_xdg_popup_destroy(popup);
-}
-
 void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface 
*parent,
                struct wlr_xdg_positioner *positioner, uint32_t id) {
        if (!wlr_xdg_positioner_is_complete(positioner)) {
@@ -409,8 +400,7 @@
                goto error_synced;
        }
        wl_resource_set_implementation(surface->popup->resource,
-               &xdg_popup_implementation, surface->popup,
-               xdg_popup_handle_resource_destroy);
+               &xdg_popup_implementation, surface->popup, NULL);
 
        surface->role = WLR_XDG_SURFACE_ROLE_POPUP;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/xwayland/xwayland.c 
new/wlroots-0.18.1/xwayland/xwayland.c
--- old/wlroots-0.18.0/xwayland/xwayland.c      2024-07-12 23:39:50.000000000 
+0200
+++ new/wlroots-0.18.1/xwayland/xwayland.c      2024-09-20 12:51:54.000000000 
+0200
@@ -91,6 +91,7 @@
        }
        xwayland->server = NULL;
        wlr_xwayland_shell_v1_destroy(xwayland->shell_v1);
+       xwm_destroy(xwayland->xwm);
        free(xwayland);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/wlroots-0.18.0/xwayland/xwm.c 
new/wlroots-0.18.1/xwayland/xwm.c
--- old/wlroots-0.18.0/xwayland/xwm.c   2024-07-12 23:39:50.000000000 +0200
+++ new/wlroots-0.18.1/xwayland/xwm.c   2024-09-20 12:51:54.000000000 +0200
@@ -1786,6 +1786,16 @@
        }
 }
 
+static void handle_shell_v1_destroy(struct wl_listener *listener,
+               void *data) {
+       struct wlr_xwm *xwm =
+               wl_container_of(listener, xwm, shell_v1_destroy);
+       wl_list_remove(&xwm->shell_v1_new_surface.link);
+       wl_list_remove(&xwm->shell_v1_destroy.link);
+       wl_list_init(&xwm->shell_v1_new_surface.link);
+       wl_list_init(&xwm->shell_v1_destroy.link);
+}
+
 void wlr_xwayland_surface_activate(struct wlr_xwayland_surface *xsurface,
                bool activated) {
        struct wlr_xwayland_surface *focused = xsurface->xwm->focus_surface;
@@ -1913,6 +1923,7 @@
        wl_list_remove(&xwm->compositor_new_surface.link);
        wl_list_remove(&xwm->compositor_destroy.link);
        wl_list_remove(&xwm->shell_v1_new_surface.link);
+       wl_list_remove(&xwm->shell_v1_destroy.link);
        xcb_disconnect(xwm->xcb_conn);
 
        struct pending_startup_id *pending, *next;
@@ -2257,6 +2268,9 @@
        xwm->shell_v1_new_surface.notify = handle_shell_v1_new_surface;
        wl_signal_add(&xwayland->shell_v1->events.new_surface,
                &xwm->shell_v1_new_surface);
+       xwm->shell_v1_destroy.notify = handle_shell_v1_destroy;
+       wl_signal_add(&xwayland->shell_v1->events.destroy,
+               &xwm->shell_v1_destroy);
 
        xwm_create_wm_window(xwm);
 

Reply via email to