Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package wbg for openSUSE:Factory checked in at 2023-11-06 21:13:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/wbg (Old) and /work/SRC/openSUSE:Factory/.wbg.new.17445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "wbg" Mon Nov 6 21:13:54 2023 rev:4 rq:1123407 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/wbg/wbg.changes 2022-11-02 15:25:35.693133840 +0100 +++ /work/SRC/openSUSE:Factory/.wbg.new.17445/wbg.changes 2023-11-06 21:14:02.250732771 +0100 @@ -1,0 +2,8 @@ +Tue Oct 24 06:38:56 UTC 2023 - Soc Virnyl Estela <[email protected]> + +- Add patchsets + * 0001-fix-mfd-noexec-seal.patch + * 0004-impl-layer-surface-closed-event.patch + * 0005-mark-surface-as-opaque.patch + +------------------------------------------------------------------- New: ---- 0001-fix-mfd-noexec-seal.patch 0004-impl-layer-surface-closed-event.patch 0005-mark-surface-as-opaque.patch BETA DEBUG BEGIN: New:- Add patchsets * 0001-fix-mfd-noexec-seal.patch * 0004-impl-layer-surface-closed-event.patch New: * 0001-fix-mfd-noexec-seal.patch * 0004-impl-layer-surface-closed-event.patch * 0005-mark-surface-as-opaque.patch New: * 0004-impl-layer-surface-closed-event.patch * 0005-mark-surface-as-opaque.patch BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ wbg.spec ++++++ --- /var/tmp/diff_new_pack.CKB9kp/_old 2023-11-06 21:14:03.446776797 +0100 +++ /var/tmp/diff_new_pack.CKB9kp/_new 2023-11-06 21:14:03.450776944 +0100 @@ -1,7 +1,7 @@ # # spec file for package wbg # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,12 @@ Group: System/GUI/Other URL: https://codeberg.org/dnkl/wbg Source0: https://codeberg.org/dnkl/wbg/archive/%version.tar.gz +# Patch 1 based of https://codeberg.org/dnkl/wbg/commit/61af8e87661b93cfefe77c083328fef962c4121d.patch +Patch1: 0001-fix-mfd-noexec-seal.patch +# Patch 4 is based of https://codeberg.org/dnkl/wbg/commit/fee19f79bb41a9f90c25b3470ec2806be7293607.patch +Patch4: 0004-impl-layer-surface-closed-event.patch +# Patch 5 is based of https://codeberg.org/dnkl/wbg/commit/670d577ad0cd45a0c7bf4a264b791a2cd86557c3.patch +Patch5: 0005-mark-surface-as-opaque.patch BuildRequires: c_compiler BuildRequires: meson >= 0.58.0 BuildRequires: pkgconfig @@ -45,7 +51,10 @@ scaled-to-fit on all monitors. %prep -%autosetup -n %name +%setup -n %name +%patch1 -p1 +%patch4 -p1 +%patch5 -p1 %build export CFLAGS="%{optflags}" ++++++ 0001-fix-mfd-noexec-seal.patch ++++++ >From 61af8e87661b93cfefe77c083328fef962c4121d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= <[email protected]> Date: Fri, 13 Oct 2023 16:37:56 +0200 Subject: [PATCH] shm: try with MFD_NOEXEC_SEAL first, then without MFD_NOEXEC_SEAL is only supported on kernels 6.3 and later. If we were compiled on linux >= 6.3, but run on linux < 6.3, we'd exit with an error, due to memfd_create() failing with EINVAL. This patch fixes the problem by first trying to call memfd_create() *with* MFD_NOEXEC_SEAL, and if that fails with EINVAL, we try again without it. Also seal the memory FD once mmap() has been called. --- shm.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/shm.c b/shm.c index adc91df..bd4ce26 100644 --- a/shm.c +++ b/shm.c @@ -1,7 +1,9 @@ #include "shm.h" -#include <unistd.h> #include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> #include <sys/types.h> #include <sys/mman.h> @@ -13,6 +15,10 @@ #include "log.h" #include "stride.h" +#if !defined(MAP_UNINITIALIZED) + #define MAP_UNINITIALIZED 0 +#endif + static void buffer_destroy(struct buffer *buf) { @@ -53,7 +59,21 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) pixman_image_t *pix = NULL; /* Backing memory for SHM */ - pool_fd = memfd_create("wbg-wayland-shm-buffer-pool", MFD_CLOEXEC); + + /* + * Older kernels reject MFD_NOEXEC_SEAL with EINVAL. Try first + * *with* it, and if that fails, try again *without* it. + */ + errno = 0; + pool_fd = memfd_create( + "wbg-wayland-shm-buffer-pool", + MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_NOEXEC_SEAL); + + if (pool_fd < 0 && errno == EINVAL) { + pool_fd = memfd_create( + "wbg-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING); + } + if (pool_fd == -1) { LOG_ERRNO("failed to create SHM backing memory file"); goto err; @@ -73,6 +93,15 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie) goto err; } + /* Seal file - we no longer allow any kind of resizing */ + /* TODO: wayland mmaps(PROT_WRITE), for some unknown reason, hence we cannot use F_SEAL_FUTURE_WRITE */ + if (fcntl(pool_fd, F_ADD_SEALS, + F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0) + { + LOG_ERRNO("failed to seal SHM backing memory file"); + /* This is not a fatal error */ + } + pool = wl_shm_create_pool(shm, pool_fd, size); if (pool == NULL) { LOG_ERR("failed to create SHM pool"); ++++++ 0004-impl-layer-surface-closed-event.patch ++++++ >From fee19f79bb41a9f90c25b3470ec2806be7293607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= <[email protected]> Date: Mon, 2 Jan 2023 12:37:02 +0100 Subject: [PATCH] main: implement layer_surface::closed() event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Destroy the surface, and clear the âconfiguredâ flag. Note that we need to take care we donât reference a destroyed output object; if the compositor destroyed the output before calling the closed() event, the âdataâ argument will be an invalid pointer. Since removing the output global _also_ destroys the surface, we can handle this by looping all known output globals, and explicitly destroy the surface if we find a match. If we donât find a match, that means the output has already been destroyed, and we donât have to do anything at all. --- CHANGELOG.md | 4 ++++ main.c | 35 +++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 7831455..03a7df6 100644 --- a/main.c +++ b/main.c @@ -139,9 +139,32 @@ layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface, render(output); } +static void +output_layer_destroy(struct output *output) +{ + if (output->layer != NULL) + zwlr_layer_surface_v1_destroy(output->layer); + if (output->surf != NULL) + wl_surface_destroy(output->surf); + + output->layer = NULL; + output->surf = NULL; + output->configured = false; +} + static void layer_surface_closed(void *data, struct zwlr_layer_surface_v1 *surface) { + struct output *output = data; + + /* Donât trust âoutputâ to be valid, in case compositor destroyed + * if before calling closed() */ + tll_foreach(outputs, it) { + if (&it->item == output) { + output_layer_destroy(output); + break; + } + } } static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { @@ -152,14 +175,14 @@ static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { static void output_destroy(struct output *output) { - free(output->make); - free(output->model); - if (output->layer != NULL) - zwlr_layer_surface_v1_destroy(output->layer); - if (output->surf != NULL) - wl_surface_destroy(output->surf); + output_layer_destroy(output); + if (output->wl_output != NULL) wl_output_release(output->wl_output); + output->wl_output = NULL; + + free(output->make); + free(output->model); } static void ++++++ 0005-mark-surface-as-opaque.patch ++++++ >From 670d577ad0cd45a0c7bf4a264b791a2cd86557c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= <[email protected]> Date: Mon, 3 Jul 2023 12:58:33 +0200 Subject: [PATCH] main: mark surface as opaque --- CHANGELOG.md | 4 ++++ main.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/main.c b/main.c index 03a7df6..6e938f0 100644 --- a/main.c +++ b/main.c @@ -267,6 +267,11 @@ add_surface_to_output(struct output *output) wl_surface_set_input_region(surf, empty_region); wl_region_destroy(empty_region); + /* Surface is fully opaque (i.e. non-transparent) */ + struct wl_region *opaque_region = wl_compositor_create_region(compositor); + wl_surface_set_opaque_region(surf, opaque_region); + wl_region_destroy(opaque_region); + struct zwlr_layer_surface_v1 *layer = zwlr_layer_shell_v1_get_layer_surface( layer_shell, surf, output->wl_output, ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND, "wallpaper"); ++++++ 1.1.0.tar.gz ++++++
