Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package swaybg for openSUSE:Factory checked in at 2026-02-26 18:54:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/swaybg (Old) and /work/SRC/openSUSE:Factory/.swaybg.new.29461 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "swaybg" Thu Feb 26 18:54:37 2026 rev:7 rq:1335210 version:1.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/swaybg/swaybg.changes 2024-04-30 17:27:41.770904957 +0200 +++ /work/SRC/openSUSE:Factory/.swaybg.new.29461/swaybg.changes 2026-02-26 18:54:44.732765100 +0100 @@ -1,0 +2,20 @@ +Thu Feb 26 07:21:19 UTC 2026 - Michael Vetter <[email protected]> + +- Update to 1.2.2: + * build: include swaybg version in version string when using git + * build: avoid git repository discovery when determining version + * Decouple wl_buffer creation and wl_surface config + * Estimate output size with wp-fractional-scale-v1 + * Fix fractional scale detection + * Fix crash when new output added + * Set default background color to black + * Only submit opaque (XRGB8888) buffers + * Use bright black rather than black for LOG_DEBUG + * build: use cc.get_supported_arguments() for warning options + * build: define _POSIX_C_SOURCE globally + * readme: drop note about packaging + * Update maintainer in man page + * build: bump version to 1.2.2 + * man: -m default to stretch + +------------------------------------------------------------------- Old: ---- swaybg-1.2.1.tar.gz New: ---- swaybg-1.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ swaybg.spec ++++++ --- /var/tmp/diff_new_pack.wp3PAX/_old 2026-02-26 18:54:46.304830959 +0100 +++ /var/tmp/diff_new_pack.wp3PAX/_new 2026-02-26 18:54:46.308831127 +0100 @@ -1,7 +1,7 @@ # # spec file for package swaybg # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: swaybg -Version: 1.2.1 +Version: 1.2.2 Release: 0 Summary: Wallpaper tool for Wayland compositors License: MIT ++++++ swaybg-1.2.1.tar.gz -> swaybg-1.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/README.md new/swaybg-1.2.2/README.md --- old/swaybg-1.2.1/README.md 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/README.md 2026-02-26 00:18:44.000000000 +0100 @@ -19,9 +19,6 @@ swaybg is available in many distributions. Try installing the "swaybg" package for yours. -If you're interested in packaging swaybg for your distribution, stop by the -IRC channel or shoot an email to [email protected] for advice. - ### Compiling from Source Install dependencies: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/log.c new/swaybg-1.2.2/log.c --- old/swaybg-1.2.1/log.c 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/log.c 2026-02-26 00:18:44.000000000 +0100 @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 199506L #include <errno.h> #include <stdarg.h> #include <stdio.h> @@ -14,7 +13,7 @@ [LOG_SILENT] = "", [LOG_ERROR ] = "\x1B[1;31m", [LOG_INFO ] = "\x1B[1;34m", - [LOG_DEBUG ] = "\x1B[1;30m", + [LOG_DEBUG ] = "\x1B[1;90m", }; void swaybg_log_init(enum log_importance verbosity) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/main.c new/swaybg-1.2.2/main.c --- old/swaybg-1.2.1/main.c 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/main.c 2026-02-26 00:18:44.000000000 +0100 @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 200809L #include <assert.h> #include <ctype.h> #include <getopt.h> @@ -15,6 +14,7 @@ #include "wlr-layer-shell-unstable-v1-client-protocol.h" #include "viewporter-client-protocol.h" #include "single-pixel-buffer-v1-client-protocol.h" +#include "fractional-scale-v1-client-protocol.h" /* * If `color` is a hexadecimal string of the form 'rrggbb' or '#rrggbb', @@ -48,6 +48,7 @@ struct zwlr_layer_shell_v1 *layer_shell; struct wp_viewporter *viewporter; struct wp_single_pixel_buffer_manager_v1 *single_pixel_buffer_manager; + struct wp_fractional_scale_manager_v1 *fract_scale_manager; struct wl_list configs; // struct swaybg_output_config::link struct wl_list outputs; // struct swaybg_output::link struct wl_list images; // struct swaybg_image::link @@ -80,99 +81,117 @@ struct wl_surface *surface; struct zwlr_layer_surface_v1 *layer_surface; + struct wp_viewport *viewport; + struct wp_fractional_scale_v1 *fract_scale; uint32_t width, height; int32_t scale; + uint32_t pref_fract_scale; uint32_t configure_serial; bool dirty, needs_ack; - int32_t committed_width, committed_height, committed_scale; + // dimensions of the wl_buffer attached to the wl_surface + uint32_t buffer_width, buffer_height; struct wl_list link; }; -static void render_frame(struct swaybg_output *output, cairo_surface_t *surface) { - int buffer_width = output->width * output->scale, - buffer_height = output->height * output->scale; - - // If the last committed buffer has the same size as this one would, do - // not render a new buffer, because it will be identical to the old one - if (output->committed_width == buffer_width && - output->committed_height == buffer_height) { - if (output->committed_scale != output->scale) { - wl_surface_set_buffer_scale(output->surface, output->scale); - wl_surface_commit(output->surface); - - output->committed_scale = output->scale; - } - return; - } +// Create a wl_buffer with the specified dimensions and content +static struct wl_buffer *draw_buffer(const struct swaybg_output *output, + cairo_surface_t *surface, uint32_t buffer_width, uint32_t buffer_height) { + uint32_t bg_color = output->config->color ? output->config->color : 0x000000ff; - if (output->config->mode == BACKGROUND_MODE_SOLID_COLOR && - output->state->viewporter && + if (buffer_width == 1 && buffer_height == 1 && + output->config->mode == BACKGROUND_MODE_SOLID_COLOR && output->state->single_pixel_buffer_manager) { - uint8_t r8 = (output->config->color >> 24) & 0xFF; - uint8_t g8 = (output->config->color >> 16) & 0xFF; - uint8_t b8 = (output->config->color >> 8) & 0xFF; - uint8_t a8 = (output->config->color >> 0) & 0xFF; + // create and return single pixel buffer + uint8_t r8 = (bg_color >> 24) & 0xFF; + uint8_t g8 = (bg_color >> 16) & 0xFF; + uint8_t b8 = (bg_color >> 8) & 0xFF; uint32_t f = 0xFFFFFFFF / 0xFF; // division result is an integer uint32_t r32 = r8 * f; uint32_t g32 = g8 * f; uint32_t b32 = b8 * f; - uint32_t a32 = a8 * f; - struct wl_buffer *buffer = wp_single_pixel_buffer_manager_v1_create_u32_rgba_buffer( - output->state->single_pixel_buffer_manager, r32, g32, b32, a32); - wl_surface_attach(output->surface, buffer, 0, 0); - wl_surface_damage_buffer(output->surface, 0, 0, INT32_MAX, INT32_MAX); - - struct wp_viewport *viewport = wp_viewporter_get_viewport( - output->state->viewporter, output->surface); - wp_viewport_set_destination(viewport, output->width, output->height); - - wl_surface_commit(output->surface); - - wp_viewport_destroy(viewport); - wl_buffer_destroy(buffer); - return; + return wp_single_pixel_buffer_manager_v1_create_u32_rgba_buffer( + output->state->single_pixel_buffer_manager, + r32, g32, b32, 0xFFFFFFFF); } + struct pool_buffer buffer; if (!create_buffer(&buffer, output->state->shm, - buffer_width, buffer_height, WL_SHM_FORMAT_ARGB8888)) { - return; + buffer_width, buffer_height, WL_SHM_FORMAT_XRGB8888)) { + return NULL; } cairo_t *cairo = buffer.cairo; - cairo_save(cairo); - cairo_set_operator(cairo, CAIRO_OPERATOR_CLEAR); + cairo_set_source_u32(cairo, bg_color); cairo_paint(cairo); - cairo_restore(cairo); - if (output->config->mode == BACKGROUND_MODE_SOLID_COLOR) { - cairo_set_source_u32(cairo, output->config->color); - cairo_paint(cairo); + + if (surface) { + render_background_image(cairo, surface, + output->config->mode, buffer_width, buffer_height); + } + + // return wl_buffer for caller to use and destroy + struct wl_buffer *wl_buf = buffer.buffer; + buffer.buffer = NULL; + destroy_buffer(&buffer); + return wl_buf; +} + +#define FRACT_DENOM 120 + +// Return the size of the buffer that should be attached to this output +static void get_buffer_size(const struct swaybg_output *output, + uint32_t *buffer_width, uint32_t *buffer_height) { + if (output->config->mode == BACKGROUND_MODE_SOLID_COLOR && + output->state->viewporter) { + *buffer_width = 1; + *buffer_height = 1; + } else if (output->pref_fract_scale && output->state->viewporter) { + // rounding mode is 'round half up' + *buffer_width = (output->width * output->pref_fract_scale + + FRACT_DENOM / 2) / FRACT_DENOM; + *buffer_height = (output->height * output->pref_fract_scale + + FRACT_DENOM / 2) / FRACT_DENOM; } else { - if (output->config->color) { - cairo_set_source_u32(cairo, output->config->color); - cairo_paint(cairo); - } + *buffer_width = output->width * output->scale; + *buffer_height = output->height * output->scale; + } +} + +static void render_frame(struct swaybg_output *output, cairo_surface_t *surface) { + uint32_t buffer_width, buffer_height; + get_buffer_size(output, &buffer_width, &buffer_height); - if (surface) { - render_background_image(cairo, surface, - output->config->mode, buffer_width, buffer_height); + // Attach a new buffer if the desired size has changed + struct wl_buffer *buf = NULL; + if (buffer_width != output->buffer_width || + buffer_height != output->buffer_height) { + buf = draw_buffer(output, surface, + buffer_width, buffer_height); + if (!buf) { + return; } - } - wl_surface_set_buffer_scale(output->surface, output->scale); - wl_surface_attach(output->surface, buffer.buffer, 0, 0); - wl_surface_damage_buffer(output->surface, 0, 0, INT32_MAX, INT32_MAX); - wl_surface_commit(output->surface); + wl_surface_attach(output->surface, buf, 0, 0); + wl_surface_damage_buffer(output->surface, 0, 0, + buffer_width, buffer_height); - output->committed_width = buffer_width; - output->committed_height = buffer_height; - output->committed_scale = output->scale; + output->buffer_width = buffer_width; + output->buffer_height = buffer_height; + } - // we will not reuse the buffer, so destroy it immediately - destroy_buffer(&buffer); + if (output->viewport) { + wp_viewport_set_destination(output->viewport, output->width, output->height); + } else { + wl_surface_set_buffer_scale(output->surface, output->scale); + } + wl_surface_commit(output->surface); + if (buf) { + wl_buffer_destroy(buf); + } } static void destroy_swaybg_image(struct swaybg_image *image) { @@ -203,6 +222,12 @@ if (output->surface != NULL) { wl_surface_destroy(output->surface); } + if (output->viewport != NULL) { + wp_viewport_destroy(output->viewport); + } + if (output->fract_scale != NULL) { + wp_fractional_scale_v1_destroy(output->fract_scale); + } wl_output_destroy(output->wl_output); free(output->name); free(output->identifier); @@ -233,6 +258,16 @@ .closed = layer_surface_closed, }; +static void fract_preferred_scale(void *data, struct wp_fractional_scale_v1 *f, + uint32_t scale) { + struct swaybg_output *output = data; + output->pref_fract_scale = scale; +} + +static const struct wp_fractional_scale_v1_listener fract_scale_listener = { + .preferred_scale = fract_preferred_scale +}; + static void output_geometry(void *data, struct wl_output *output, int32_t x, int32_t y, int32_t width_mm, int32_t height_mm, int32_t subpixel, const char *make, const char *model, int32_t transform) { @@ -255,6 +290,21 @@ wl_surface_set_input_region(output->surface, input_region); wl_region_destroy(input_region); + if (output->state->fract_scale_manager) { + output->fract_scale = wp_fractional_scale_manager_v1_get_fractional_scale( + output->state->fract_scale_manager, output->surface); + assert(output->fract_scale); + wp_fractional_scale_v1_add_listener(output->fract_scale, + &fract_scale_listener, output); + } + + if (output->state->viewporter && + (output->config->mode == BACKGROUND_MODE_SOLID_COLOR || + output->state->fract_scale_manager)) { + output->viewport = wp_viewporter_get_viewport( + output->state->viewporter, output->surface); + } + output->layer_surface = zwlr_layer_shell_v1_get_layer_surface( output->state->layer_shell, output->surface, output->wl_output, ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND, "wallpaper"); @@ -359,6 +409,7 @@ } else if (strcmp(interface, wl_output_interface.name) == 0) { struct swaybg_output *output = calloc(1, sizeof(struct swaybg_output)); output->state = state; + output->scale = 1; output->wl_name = name; output->wl_output = wl_registry_bind(registry, name, &wl_output_interface, 4); @@ -374,6 +425,9 @@ wp_single_pixel_buffer_manager_v1_interface.name) == 0) { state->single_pixel_buffer_manager = wl_registry_bind(registry, name, &wp_single_pixel_buffer_manager_v1_interface, 1); + } else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0) { + state->fract_scale_manager = wl_registry_bind(registry, name, + &wp_fractional_scale_manager_v1_interface, 1); } } @@ -589,13 +643,14 @@ output->configure_serial); } - int buffer_width = output->width * output->scale, - buffer_height = output->height * output->scale; - bool buffer_change = - output->committed_height != buffer_height || - output->committed_width != buffer_width; - if (output->dirty && output->config->image && buffer_change) { - output->config->image->load_required = true; + if (output->dirty) { + uint32_t buffer_width, buffer_height; + get_buffer_size(output, &buffer_width, &buffer_height); + bool buffer_change = output->buffer_width != buffer_width || + output->buffer_height != buffer_height; + if (output->config->image && buffer_change) { + output->config->image->load_required = true; + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/meson.build new/swaybg-1.2.2/meson.build --- old/swaybg-1.2.1/meson.build 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/meson.build 2026-02-26 00:18:44.000000000 +0100 @@ -1,7 +1,7 @@ project( 'swaybg', 'c', - version: '1.2.1', + version: '1.2.2', license: 'MIT', meson_version: '>=0.59.0', default_options: [ @@ -11,26 +11,26 @@ ], ) -add_project_arguments( - [ - '-Wno-unused-parameter', - '-Wno-unused-result', - '-Wundef', - '-Wvla', - ], - language: 'c', -) +cc = meson.get_compiler('c') + +add_project_arguments('-D_POSIX_C_SOURCE=200809L', language: 'c') + +add_project_arguments(cc.get_supported_arguments([ + '-Wno-unused-parameter', + '-Wno-unused-result', + '-Wundef', + '-Wvla', +]), language: 'c') is_freebsd = host_machine.system().startswith('freebsd') if is_freebsd add_project_arguments('-D_C11_SOURCE', language: 'c') endif -cc = meson.get_compiler('c') rt = cc.find_library('rt') wayland_client = dependency('wayland-client') -wayland_protos = dependency('wayland-protocols', version: '>=1.26') +wayland_protos = dependency('wayland-protocols', version: '>=1.31') wayland_scanner = dependency('wayland-scanner', version: '>=1.14.91', native: true) cairo = dependency('cairo') gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) @@ -40,10 +40,14 @@ version = '"@0@"'.format(meson.project_version()) if git.found() - git_commit_hash = run_command([git, 'describe', '--always', '--tags'], check: false) - git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) - if git_commit_hash.returncode() == 0 and git_branch.returncode() == 0 - version = '"@0@ (" __DATE__ ", branch \'@1@\')"'.format(git_commit_hash.stdout().strip(), git_branch.stdout().strip()) + git_commit = run_command([git, '--git-dir=.git', 'rev-parse', '--short', 'HEAD'], check: false) + git_branch = run_command([git, '--git-dir=.git', 'rev-parse', '--abbrev-ref', 'HEAD'], check: false) + if git_commit.returncode() == 0 and git_branch.returncode() == 0 + version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format( + meson.project_version(), + git_commit.stdout().strip(), + git_branch.stdout().strip(), + ) endif endif @@ -74,6 +78,7 @@ wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml', wl_protocol_dir / 'stable/viewporter/viewporter.xml', wl_protocol_dir / 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml', + wl_protocol_dir / 'staging/fractional-scale/fractional-scale-v1.xml', 'wlr-layer-shell-unstable-v1.xml', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/pool-buffer.c new/swaybg-1.2.2/pool-buffer.c --- old/swaybg-1.2.1/pool-buffer.c 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/pool-buffer.c 2026-02-26 00:18:44.000000000 +0100 @@ -1,4 +1,3 @@ -#define _POSIX_C_SOURCE 200809 #include <assert.h> #include <cairo.h> #include <errno.h> @@ -60,7 +59,7 @@ buf->size = size; buf->data = data; buf->surface = cairo_image_surface_create_for_data(data, - CAIRO_FORMAT_ARGB32, width, height, stride); + CAIRO_FORMAT_RGB24, width, height, stride); buf->cairo = cairo_create(buf->surface); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/swaybg-1.2.1/swaybg.1.scd new/swaybg-1.2.2/swaybg.1.scd --- old/swaybg-1.2.1/swaybg.1.scd 2024-04-28 10:09:42.000000000 +0200 +++ new/swaybg-1.2.2/swaybg.1.scd 2026-02-26 00:18:44.000000000 +0100 @@ -26,9 +26,9 @@ Set the background image. *-m, --mode* <mode> - Scaling mode for images: _stretch_, _fill_, _fit_, _center_, or _tile_. Use - the additional mode _solid\_color_ to display only the background color, - even if a background image is specified. + Scaling mode for images: _stretch_, _fill_, _fit_, _center_, or _tile_. + Default is _stretch_. Use the additional mode _solid\_color_ to display + only the background color, even if a background image is specified. *-o, --output* <name> Select an output to configure. Subsequent appearance options will only @@ -39,6 +39,6 @@ # AUTHORS -Maintained by Drew DeVault <[email protected]>, who is assisted by other open +Maintained by Simon Ser <[email protected]>, who is assisted by other open source contributors. For more information about swaybg development, see -https://github.com/swaywm/swaybg. +<https://github.com/swaywm/swaybg>.
