Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package wbg for openSUSE:Factory checked in at 2022-11-02 15:25:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/wbg (Old) and /work/SRC/openSUSE:Factory/.wbg.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "wbg" Wed Nov 2 15:25:34 2022 rev:3 rq:1032897 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/wbg/wbg.changes 2022-05-30 12:44:41.808450134 +0200 +++ /work/SRC/openSUSE:Factory/.wbg.new.2275/wbg.changes 2022-11-02 15:25:35.693133840 +0100 @@ -1,0 +2,11 @@ +Wed Oct 26 12:37:03 UTC 2022 - Soc Virnyl Estela <socvirnyl.est...@gmail.com> + +- Update to version 1.1.0: + - Added: + * webp support + - Fixed: + * meson: can???t use `SOURCE_DIR` in `custom_targets()`. + * build: version script is now run in a C locale. + * Don???t re-render frame on same-size configure events + +------------------------------------------------------------------- Old: ---- 1.0.2.tar.gz New: ---- 1.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ wbg.spec ++++++ --- /var/tmp/diff_new_pack.CZ3j8R/_old 2022-11-02 15:25:36.325137064 +0100 +++ /var/tmp/diff_new_pack.CZ3j8R/_new 2022-11-02 15:25:36.329137085 +0100 @@ -17,19 +17,20 @@ Name: wbg -Version: 1.0.2 +Version: 1.1.0 Release: 0 Summary: Wallpaper application for layer-shell Wayland compositors License: MIT Group: System/GUI/Other URL: https://codeberg.org/dnkl/wbg Source0: https://codeberg.org/dnkl/wbg/archive/%version.tar.gz -BuildRequires: gcc-c++ +BuildRequires: c_compiler BuildRequires: meson >= 0.58.0 BuildRequires: pkgconfig BuildRequires: python3 BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(pixman-1) BuildRequires: pkgconfig(tllist) >= 1.0.1 BuildRequires: pkgconfig(wayland-client) @@ -49,7 +50,6 @@ %build export CFLAGS="%{optflags}" %meson - %meson_build %install ++++++ 1.0.2.tar.gz -> 1.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/CHANGELOG.md new/wbg/CHANGELOG.md --- old/wbg/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/wbg/CHANGELOG.md 2022-10-24 16:44:22.000000000 +0200 @@ -0,0 +1,22 @@ +# Changelog + +* [1.1.0](#1-1-0) + + +## 1.1.0 + +### Added + +* webp support + + +### Fixed + +* meson: can???t use `SOURCE_DIR` in `custom_targets()`. +* build: version script is now run in a C locale. +* Don???t re-render frame on same-size configure events + + +### Contributors + +* Leonardo Hern??ndez diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/PKGBUILD new/wbg/PKGBUILD --- old/wbg/PKGBUILD 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/PKGBUILD 2022-10-24 16:44:22.000000000 +0200 @@ -1,12 +1,12 @@ pkgname=wbg -pkgver=1.0.1 +pkgver=1.1.0 pkgrel=1 pkgdesc="Super simple wallpaper application" arch=('x86_64' 'aarch64') url=https://codeberg.org/dnkl/wbg license=(mit) -makedepends=('meson' 'ninja' 'tllist>=1.0.1') -depends=('wayland' 'libjpeg-turbo' 'libpng') +makedepends=('meson' 'ninja' 'wayland-protocols' 'tllist>=1.0.1') +depends=('wayland' 'pixman' 'libjpeg-turbo' 'libpng') source=() pkgver() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/README.md new/wbg/README.md --- old/wbg/README.md 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/README.md 2022-10-24 16:44:22.000000000 +0200 @@ -9,6 +9,8 @@ More display options, and/or the ability to set a per-monitor wallpaper _may_ be added in the future. +[](https://repology.org/project/wbg/versions) + ## Requirements @@ -18,8 +20,9 @@ * wayland (_client_ and _cursor_ libraries) * libpng (optional) * libjpeg (optional) +* libwebp (optional) -Note that at least one of _libpng_ and _libjpeg_ is required. +Note that at least one of _libpng_, _libjpeg_ and _libwebp_ is required. ### Compile time @@ -37,6 +40,13 @@ sudo ninja -C build install ``` -By default, PNG and JPEG support is auto-detected. You can force +By default, PNG, JPEG and WebP support is auto-detected. You can force disable/enable them with the meson command line options -`-Dpng=disabled|enabled` and `-Djpeg=disabled|enabled`. +`-Dpng=disabled|enabled`, `-Djpeg=disabled|enabled` and +`-Dwebp=disabled|enabled`. + + +## Derivative work + +* https://codeberg.org/droc12345/wbg - adds support for directories + with images, random, timer flags. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/external/wlr-layer-shell-unstable-v1.xml new/wbg/external/wlr-layer-shell-unstable-v1.xml --- old/wbg/external/wlr-layer-shell-unstable-v1.xml 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/external/wlr-layer-shell-unstable-v1.xml 2022-10-24 16:44:22.000000000 +0200 @@ -25,7 +25,7 @@ THIS SOFTWARE. </copyright> - <interface name="zwlr_layer_shell_v1" version="3"> + <interface name="zwlr_layer_shell_v1" version="4"> <description summary="create surfaces that are layers of the desktop"> Clients can use this interface to assign the surface_layer role to wl_surfaces. Such surfaces are assigned to a "layer" of the output and @@ -47,6 +47,12 @@ or manipulate a buffer prior to the first layer_surface.configure call must also be treated as errors. + After creating a layer_surface object and setting it up, the client + must perform an initial commit without any buffer attached. + The compositor will reply with a layer_surface.configure event. + The client must acknowledge it and is then allowed to attach a buffer + to map the surface. + You may pass NULL for output to allow the compositor to decide which output to use. Generally this will be the one that the user most recently interacted with. @@ -94,7 +100,7 @@ </request> </interface> - <interface name="zwlr_layer_surface_v1" version="3"> + <interface name="zwlr_layer_surface_v1" version="4"> <description summary="layer metadata interface"> An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like @@ -103,6 +109,14 @@ Layer surface state (layer, size, anchor, exclusive zone, margin, interactivity) is double-buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. + + Attaching a null buffer to a layer surface unmaps it. + + Unmapping a layer_surface means that the surface cannot be shown by the + compositor until it is explicitly mapped again. The layer_surface + returns to the state it had right after layer_shell.get_layer_surface. + The client can re-map the surface by performing a commit without any + buffer attached, waiting for a configure event and handling it as usual. </description> <request name="set_size"> @@ -189,21 +203,85 @@ <arg name="left" type="int"/> </request> + <enum name="keyboard_interactivity"> + <description summary="types of keyboard interaction possible for a layer shell surface"> + Types of keyboard interaction possible for layer shell surfaces. The + rationale for this is twofold: (1) some applications are not interested + in keyboard events and not allowing them to be focused can improve the + desktop experience; (2) some applications will want to take exclusive + keyboard focus. + </description> + + <entry name="none" value="0"> + <description summary="no keyboard focus is possible"> + This value indicates that this surface is not interested in keyboard + events and the compositor should never assign it the keyboard focus. + + This is the default value, set for newly created layer shell surfaces. + + This is useful for e.g. desktop widgets that display information or + only have interaction with non-keyboard input devices. + </description> + </entry> + <entry name="exclusive" value="1"> + <description summary="request exclusive keyboard focus"> + Request exclusive keyboard focus if this surface is above the shell surface layer. + + For the top and overlay layers, the seat will always give + exclusive keyboard focus to the top-most layer which has keyboard + interactivity set to exclusive. If this layer contains multiple + surfaces with keyboard interactivity set to exclusive, the compositor + determines the one receiving keyboard events in an implementation- + defined manner. In this case, no guarantee is made when this surface + will receive keyboard focus (if ever). + + For the bottom and background layers, the compositor is allowed to use + normal focus semantics. + + This setting is mainly intended for applications that need to ensure + they receive all keyboard events, such as a lock screen or a password + prompt. + </description> + </entry> + <entry name="on_demand" value="2" since="4"> + <description summary="request regular keyboard focus semantics"> + This requests the compositor to allow this surface to be focused and + unfocused by the user in an implementation-defined manner. The user + should be able to unfocus this surface even regardless of the layer + it is on. + + Typically, the compositor will want to use its normal mechanism to + manage keyboard focus between layer shell surfaces with this setting + and regular toplevels on the desktop layer (e.g. click to focus). + Nevertheless, it is possible for a compositor to require a special + interaction to focus or unfocus layer shell surfaces (e.g. requiring + a click even if focus follows the mouse normally, or providing a + keybinding to switch focus between layers). + + This setting is mainly intended for desktop shell components (e.g. + panels) that allow keyboard interaction. Using this option can allow + implementing a desktop shell that can be fully usable without the + mouse. + </description> + </entry> + </enum> + <request name="set_keyboard_interactivity"> <description summary="requests keyboard events"> - Set to 1 to request that the seat send keyboard events to this layer - surface. For layers below the shell surface layer, the seat will use - normal focus semantics. For layers above the shell surface layers, the - seat will always give exclusive keyboard focus to the top-most layer - which has keyboard interactivity set to true. + Set how keyboard events are delivered to this surface. By default, + layer shell surfaces do not receive keyboard events; this request can + be used to change this. + + This setting is inherited by child surfaces set by the get_popup + request. Layer surfaces receive pointer, touch, and tablet events normally. If you do not want to receive them, set the input region on your surface to an empty region. - Events is double-buffered, see wl_surface.commit. + Keyboard interactivity is double-buffered, see wl_surface.commit. </description> - <arg name="keyboard_interactivity" type="uint"/> + <arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/> </request> <request name="get_popup"> @@ -288,6 +366,7 @@ <entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/> <entry name="invalid_size" value="1" summary="size is invalid"/> <entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/> + <entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/> </enum> <enum name="anchor" bitfield="true"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/generate-version.sh new/wbg/generate-version.sh --- old/wbg/generate-version.sh 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/generate-version.sh 2022-10-24 16:44:22.000000000 +0200 @@ -17,12 +17,12 @@ git_branch=$(git rev-parse --abbrev-ref HEAD) cd "${workdir}" - new_version="${git_version} ($(env LC_TIME=C date "+%b %d %Y"), branch '${git_branch}')" + new_version="${git_version} ($(date "+%b %d %Y"), branch '${git_branch}')" else new_version="${default_version}" fi -new_version="#define FUZZEL_VERSION \"${new_version}\"" +new_version="#define WBG_VERSION \"${new_version}\"" if [ -f "${out_file}" ]; then old_version=$(cat "${out_file}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/main.c new/wbg/main.c --- old/wbg/main.c 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/main.c 2022-10-24 16:44:22.000000000 +0200 @@ -22,6 +22,7 @@ #define LOG_ENABLE_DBG 0 #include "log.h" #include "shm.h" +#include "version.h" #if defined(WBG_HAVE_PNG) #include "png-wbg.h" @@ -29,6 +30,9 @@ #if defined(WBG_HAVE_JPG) #include "jpg.h" #endif +#if defined(WBG_HAVE_WEBP) + #include "webp.h" +#endif /* Top-level globals */ static struct wl_display *display; @@ -116,10 +120,22 @@ uint32_t serial, uint32_t w, uint32_t h) { struct output *output = data; + zwlr_layer_surface_v1_ack_configure(surface, serial); + + /* If the size of the last committed buffer has not change, do not + * render a new buffer because it will be identical to the old one. */ + /* TODO: should we check the scale? */ + if (output->configured && + output->render_width == w && + output->render_height == h) + { + wl_surface_commit(output->surf); + return; + } + output->render_width = w; output->render_height = h; output->configured = true; - zwlr_layer_surface_v1_ack_configure(surface, serial); render(output); } @@ -337,6 +353,8 @@ setlocale(LC_CTYPE, ""); log_init(LOG_COLORIZE_AUTO, false, LOG_FACILITY_DAEMON, LOG_CLASS_WARNING); + LOG_INFO("%s", WBG_VERSION); + const char *image_path = argv[1]; image = NULL; @@ -354,6 +372,10 @@ if (image == NULL) image = png_load(fp, image_path); #endif +#if defined(WBG_HAVE_WEBP) + if (image == NULL) + image = webp_load(fp, image_path); +#endif if (image == NULL) { fprintf(stderr, "error: %s: failed to load\n", image_path); fclose(fp); @@ -423,7 +445,7 @@ int ret = poll(fds, sizeof(fds) / sizeof(fds[0]), -1); if (ret < 0) { - if (ret == EINTR) + if (errno == EINTR) continue; LOG_ERRNO("failed to poll"); @@ -435,8 +457,12 @@ break; } - if (fds[0].revents & POLLIN) - wl_display_dispatch(display); + if (fds[0].revents & POLLIN) { + if (wl_display_dispatch(display) < 0) { + LOG_ERRNO("failed to dispatch Wayland events"); + break; + } + } if (fds[1].revents & POLLHUP) abort(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/meson.build new/wbg/meson.build --- old/wbg/meson.build 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/meson.build 2022-10-24 16:44:22.000000000 +0200 @@ -1,7 +1,7 @@ project('wbg', 'c', - version: '1.0.1', + version: '1.1.0', license: 'MIT', - meson_version: '>=0.53.0', + meson_version: '>=0.58.0', default_options: [ 'c_std=c18', 'warning_level=1', @@ -20,7 +20,7 @@ # Compute the relative path used by compiler invocations. source_root = meson.current_source_dir().split('/') -build_root = meson.build_root().split('/') +build_root = meson.global_build_root().split('/') relative_dir_parts = [] i = 0 in_prefix = true @@ -49,8 +49,9 @@ pixman = dependency('pixman-1') png = dependency('libpng', required: get_option('png')) jpg = dependency('libjpeg', required: get_option('jpeg')) +webp = dependency('libwebp', required: get_option('webp')) -if not png.found() and not jpg.found() +if not png.found() and not jpg.found() and not webp.found() error('you must enable at least one image format') endif @@ -60,16 +61,19 @@ if jpg.found() add_project_arguments('-DWBG_HAVE_JPG=1', language:'c') endif +if webp.found() + add_project_arguments('-DWBG_HAVE_WEBP=1', language:'c') +endif wayland_protocols = dependency('wayland-protocols') wayland_client = dependency('wayland-client') tllist = dependency('tllist', version: '>=1.0.1', fallback: 'tllist') -wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir') +wayland_protocols_datadir = wayland_protocols.get_variable('pkgdatadir') wscanner = dependency('wayland-scanner', native: true) wscanner_prog = find_program( - wscanner.get_pkgconfig_variable('wayland_scanner'), native: true) + wscanner.get_variable('wayland_scanner'), native: true) wl_proto_headers = [] wl_proto_src = [] @@ -91,12 +95,13 @@ command: [wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@']) endforeach +env = find_program('env', native: true) generate_version_sh = files('generate-version.sh') version = custom_target( 'generate_version', build_always_stale: true, output: 'version.h', - command: [generate_version_sh, meson.project_version(), '@SOURCE_DIR@', '@OUTPUT@']) + command: [env, 'LC_ALL=C', generate_version_sh, meson.project_version(), '@CURRENT_SOURCE_DIR@', '@OUTPUT@']) image_format_sources = [] if png.found() @@ -105,6 +110,9 @@ if jpg.found() image_format_sources += ['jpg.c', 'jpg.h'] endif +if webp.found() + image_format_sources += ['webp.c', 'webp.h'] +endif executable( 'wbg', @@ -114,13 +122,14 @@ 'stride.h', image_format_sources, wl_proto_src + wl_proto_headers, version, - dependencies: [pixman, png, jpg, wayland_client, tllist], + dependencies: [pixman, png, jpg, webp, wayland_client, tllist], install: true) summary( { 'PNG support': png.found(), 'JPEG support': jpg.found(), + 'WebP support': webp.found(), }, bool_yn: true ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/meson_options.txt new/wbg/meson_options.txt --- old/wbg/meson_options.txt 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/meson_options.txt 2022-10-24 16:44:22.000000000 +0200 @@ -1,2 +1,3 @@ option('png', type: 'feature') option('jpeg', type: 'feature') +option('webp', type: 'feature') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/shm.c new/wbg/shm.c --- old/wbg/shm.c 2020-12-03 18:30:50.000000000 +0100 +++ new/wbg/shm.c 2022-10-24 16:44:22.000000000 +0200 @@ -53,7 +53,7 @@ pixman_image_t *pix = NULL; /* Backing memory for SHM */ - pool_fd = memfd_create("fuzzel-wayland-shm-buffer-pool", MFD_CLOEXEC); + pool_fd = memfd_create("wbg-wayland-shm-buffer-pool", MFD_CLOEXEC); if (pool_fd == -1) { LOG_ERRNO("failed to create SHM backing memory file"); goto err; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/webp.c new/wbg/webp.c --- old/wbg/webp.c 1970-01-01 01:00:00.000000000 +0100 +++ new/wbg/webp.c 2022-10-24 16:44:22.000000000 +0200 @@ -0,0 +1,71 @@ +#include "webp.h" +#include <stdlib.h> +#include <stdio.h> + +#include <webp/decode.h> + +#define LOG_MODULE "webp" +#define LOG_ENABLE_DBG 0 +#include "log.h" +#include "stride.h" + +pixman_image_t * +webp_load(FILE *fp, const char *path) +{ + uint8_t *file_data = NULL; + uint8_t *image_data = NULL; + size_t image_size; + bool ok = false; + pixman_image_t *pix = NULL; + pixman_format_code_t format; + int width, height, stride; + + if (fseek(fp, 0, SEEK_END) < 0) { + LOG_ERRNO("%s: failed to seek to end of file", path); + return NULL; + } + image_size = ftell(fp); + if (fseek(fp, 0, SEEK_SET) < 0) { + LOG_ERRNO("%s: failed to seek to beginning of file", path); + return NULL; + } + + if (!(file_data = WebPMalloc(image_size + 1))) { + goto out; + } + + clearerr(fp); + if (fread(file_data, image_size, 1, fp) != image_size && ferror(fp)) { + LOG_ERRNO("%s: failed to read", path); + goto out; + } + file_data[image_size] = '\0'; + + /* Verify it is a webp image */ + if (!WebPGetInfo(file_data, image_size, NULL, NULL)) { + LOG_ERR("%s: not a WebP file", path); + goto out; + } + + image_data = WebPDecodeRGBA(file_data, image_size, &width, &height); + if (image_data == NULL) { + goto out; + } + format = PIXMAN_x8b8g8r8; + stride = stride_for_format_and_width(format, width); + + ok = NULL != (pix = pixman_image_create_bits_no_clear( + format, width, height, (uint32_t *)image_data, stride)); + + if (!ok) { + LOG_ERR("%s: failed to instantiate pixman image", path); + goto out; + } + +out: + WebPFree(file_data); + if (!ok) + WebPFree(image_data); + + return pix; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wbg/webp.h new/wbg/webp.h --- old/wbg/webp.h 1970-01-01 01:00:00.000000000 +0100 +++ new/wbg/webp.h 2022-10-24 16:44:22.000000000 +0200 @@ -0,0 +1,6 @@ +#pragma once + +#include <stdio.h> +#include <pixman.h> + +pixman_image_t *webp_load(FILE *fp, const char *path);