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-01-03 12:27:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/wlroots (Old) and /work/SRC/openSUSE:Factory/.wlroots.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "wlroots" Wed Jan 3 12:27:31 2024 rev:29 rq:1135923 version:0.17.1 Changes: -------- --- /work/SRC/openSUSE:Factory/wlroots/wlroots.changes 2023-12-21 23:38:32.414377551 +0100 +++ /work/SRC/openSUSE:Factory/.wlroots.new.28375/wlroots.changes 2024-01-03 12:27:38.085277707 +0100 @@ -1,0 +2,22 @@ +Mon Jan 1 00:51:49 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl> + +- Update to version 0.17.1: + * backend/x11: don't send ConfigureRequest with the same size + * backend/x11: check buffer format in output_test() + * tinywl: fix wlroots dependency constraint in Makefile + * viewporter: rename state var in viewport_handle_surface_commit() + * viewporter: listen to client_commit + * viewporter: fix src buffer bounds check + * render/egl: fallback to GBM FD if EGLDevice is not available + * render: disable linux-dmabuf without DRM FD + * cursor: send surface scale events + * cursor: fix initial cursor position for new outputs + * xcursor: fix duplicate cursor check check in load_callback() + * input-method-v2: drop unnecessary variable and cast + * output-layout: fix missing global for outputs with a custom mode + * build: bump vesion to 0.17.1 + * types/output: emit destroy event before destroying global + * input-method-v2: free current strings on commit + * input-method-v2: validate commit serial + +------------------------------------------------------------------- Old: ---- wlroots-0.17.0.tar.gz wlroots-0.17.0.tar.gz.sig New: ---- wlroots-0.17.1.tar.gz wlroots-0.17.1.tar.gz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ wlroots.spec ++++++ --- /var/tmp/diff_new_pack.HfkQYE/_old 2024-01-03 12:27:38.765302541 +0100 +++ /var/tmp/diff_new_pack.HfkQYE/_new 2024-01-03 12:27:38.765302541 +0100 @@ -1,7 +1,7 @@ # # spec file for package wlroots # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ %bcond_without xcb_errors Name: wlroots -Version: 0.17.0 +Version: 0.17.1 Release: 0 Summary: Modular Wayland compositor library License: MIT ++++++ wlroots-0.17.0.tar.gz -> wlroots-0.17.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/backend/x11/output.c new/wlroots-0.17.1/backend/x11/output.c --- old/wlroots-0.17.0/backend/x11/output.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/backend/x11/output.c 2023-12-21 19:42:26.000000000 +0100 @@ -64,6 +64,10 @@ struct wlr_x11_output *output = get_x11_output_from_output(wlr_output); struct wlr_x11_backend *x11 = output->x11; + if (width == output->win_width && height == output->win_height) { + return true; + } + const uint32_t values[] = { width, height }; xcb_void_cookie_t cookie = xcb_configure_window_checked( x11->xcb, output->win, @@ -77,6 +81,9 @@ return false; } + output->win_width = width; + output->win_height = height; + // Move the pointer to its new location update_x11_pointer_position(output, output->x11->time); @@ -114,6 +121,9 @@ static bool output_test(struct wlr_output *wlr_output, const struct wlr_output_state *state) { + struct wlr_x11_output *output = get_x11_output_from_output(wlr_output); + struct wlr_x11_backend *x11 = output->x11; + uint32_t unsupported = state->committed & ~SUPPORTED_OUTPUT_STATE; if (unsupported != 0) { wlr_log(WLR_DEBUG, "Unsupported output state fields: 0x%"PRIx32, @@ -133,6 +143,22 @@ } } + if (state->committed & WLR_OUTPUT_STATE_BUFFER) { + struct wlr_buffer *buffer = state->buffer; + struct wlr_dmabuf_attributes dmabuf_attrs; + struct wlr_shm_attributes shm_attrs; + uint32_t format = DRM_FORMAT_INVALID; + if (wlr_buffer_get_dmabuf(buffer, &dmabuf_attrs)) { + format = dmabuf_attrs.format; + } else if (wlr_buffer_get_shm(buffer, &shm_attrs)) { + format = shm_attrs.format; + } + if (format != x11->x11_format->drm) { + wlr_log(WLR_DEBUG, "Unsupported buffer format"); + return false; + } + } + if (state->committed & WLR_OUTPUT_STATE_MODE) { assert(state->mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM); @@ -579,6 +605,9 @@ x11->screen->root, 0, 0, wlr_output->width, wlr_output->height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, x11->visualid, mask, values); + output->win_width = wlr_output->width; + output->win_height = wlr_output->height; + struct { xcb_input_event_mask_t head; xcb_input_xi_event_mask_t mask; @@ -640,6 +669,9 @@ return; } + output->win_width = ev->width; + output->win_height = ev->height; + struct wlr_output_state state; wlr_output_state_init(&state); wlr_output_state_set_custom_mode(&state, ev->width, ev->height, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/include/backend/x11.h new/wlroots-0.17.1/include/backend/x11.h --- old/wlroots-0.17.0/include/backend/x11.h 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/include/backend/x11.h 2023-12-21 19:42:26.000000000 +0100 @@ -35,6 +35,8 @@ xcb_window_t win; xcb_present_event_t present_event_id; + int32_t win_width, win_height; + struct wlr_pointer pointer; struct wlr_touch touch; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/meson.build new/wlroots-0.17.1/meson.build --- old/wlroots-0.17.0/meson.build 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/meson.build 2023-12-21 19:42:26.000000000 +0100 @@ -1,7 +1,7 @@ project( 'wlroots', 'c', - version: '0.17.0', + version: '0.17.1', license: 'MIT', meson_version: '>=0.59.0', default_options: [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/render/egl.c new/wlroots-0.17.1/render/egl.c --- old/wlroots-0.17.0/render/egl.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/render/egl.c 2023-12-21 19:42:26.000000000 +0100 @@ -954,7 +954,7 @@ return render_name; } -int wlr_egl_dup_drm_fd(struct wlr_egl *egl) { +static int dup_egl_device_drm_fd(struct wlr_egl *egl) { if (egl->device == EGL_NO_DEVICE_EXT || (!egl->exts.EXT_device_drm && !egl->exts.EXT_device_drm_render_node)) { return -1; @@ -1001,3 +1001,21 @@ return render_fd; } + +int wlr_egl_dup_drm_fd(struct wlr_egl *egl) { + int fd = dup_egl_device_drm_fd(egl); + if (fd >= 0) { + return fd; + } + + // Fallback to GBM's FD if we can't use EGLDevice + if (egl->gbm_device == NULL) { + return -1; + } + + fd = fcntl(gbm_device_get_fd(egl->gbm_device), F_DUPFD_CLOEXEC, 0); + if (fd < 0) { + wlr_log_errno(WLR_ERROR, "Failed to dup GBM FD"); + } + return fd; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/render/wlr_renderer.c new/wlroots-0.17.1/render/wlr_renderer.c --- old/wlroots-0.17.0/render/wlr_renderer.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/render/wlr_renderer.c 2023-12-21 19:42:26.000000000 +0100 @@ -228,13 +228,10 @@ return false; } - if (wlr_renderer_get_dmabuf_texture_formats(r) != NULL) { - if (wlr_renderer_get_drm_fd(r) >= 0) { - if (wlr_drm_create(wl_display, r) == NULL) { - return false; - } - } else { - wlr_log(WLR_INFO, "Cannot get renderer DRM FD, disabling wl_drm"); + if (wlr_renderer_get_dmabuf_texture_formats(r) != NULL && + wlr_renderer_get_drm_fd(r) >= 0) { + if (wlr_drm_create(wl_display, r) == NULL) { + return false; } if (wlr_linux_dmabuf_v1_create_with_renderer(wl_display, 4, r) == NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/tinywl/Makefile new/wlroots-0.17.1/tinywl/Makefile --- old/wlroots-0.17.0/tinywl/Makefile 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/tinywl/Makefile 2023-12-21 19:42:26.000000000 +0100 @@ -1,7 +1,7 @@ WAYLAND_PROTOCOLS=$(shell pkg-config --variable=pkgdatadir wayland-protocols) WAYLAND_SCANNER=$(shell pkg-config --variable=wayland_scanner wayland-scanner) LIBS=\ - $(shell pkg-config --cflags --libs "wlroots >= 0.17.0-dev") \ + $(shell pkg-config --cflags --libs "wlroots >= 0.17.0") \ $(shell pkg-config --cflags --libs wayland-server) \ $(shell pkg-config --cflags --libs xkbcommon) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/types/output/output.c new/wlroots-0.17.1/types/output/output.c --- old/wlroots-0.17.0/types/output/output.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/types/output/output.c 2023-12-21 19:42:26.000000000 +0100 @@ -450,11 +450,12 @@ return; } + wl_signal_emit_mutable(&output->events.destroy, output); + wl_list_remove(&output->display_destroy.link); wlr_output_destroy_global(output); output_clear_back_buffer(output); - wl_signal_emit_mutable(&output->events.destroy, output); wlr_addon_set_finish(&output->addons); // The backend is responsible for free-ing the list of modes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/types/wlr_cursor.c new/wlroots-0.17.1/types/wlr_cursor.c --- old/wlroots-0.17.0/types/wlr_cursor.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/types/wlr_cursor.c 2023-12-21 19:42:26.000000000 +0100 @@ -6,6 +6,7 @@ #include <stdlib.h> #include <wayland-server-core.h> #include <wlr/types/wlr_cursor.h> +#include <wlr/types/wlr_fractional_scale_v1.h> #include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_output.h> @@ -264,6 +265,16 @@ return ret; } +static void output_cursor_move(struct wlr_cursor_output_cursor *output_cursor) { + struct wlr_cursor *cur = output_cursor->cursor; + + double output_x = cur->x, output_y = cur->y; + wlr_output_layout_output_coords(cur->state->layout, + output_cursor->output_cursor->output, &output_x, &output_y); + wlr_output_cursor_move(output_cursor->output_cursor, + output_x, output_y); +} + static void cursor_warp_unchecked(struct wlr_cursor *cur, double lx, double ly) { assert(cur->state->layout); @@ -272,17 +283,13 @@ return; } + cur->x = lx; + cur->y = ly; + struct wlr_cursor_output_cursor *output_cursor; wl_list_for_each(output_cursor, &cur->state->output_cursors, link) { - double output_x = lx, output_y = ly; - wlr_output_layout_output_coords(cur->state->layout, - output_cursor->output_cursor->output, &output_x, &output_y); - wlr_output_cursor_move(output_cursor->output_cursor, - output_x, output_y); + output_cursor_move(output_cursor); } - - cur->x = lx; - cur->y = ly; } /** @@ -545,6 +552,16 @@ } else { wlr_surface_send_leave(surface, output); } + + float scale = 1; + struct wlr_surface_output *surface_output; + wl_list_for_each(surface_output, &surface->current_outputs, link) { + if (surface_output->output->scale > scale) { + scale = surface_output->output->scale; + } + } + wlr_fractional_scale_v1_notify_scale(surface, scale); + wlr_surface_set_preferred_buffer_scale(surface, ceil(scale)); } else if (cur->state->xcursor_name != NULL) { struct wlr_xcursor_manager *manager = cur->state->xcursor_manager; const char *name = cur->state->xcursor_name; @@ -1094,6 +1111,7 @@ &output_cursor->output_commit); output_cursor->output_commit.notify = output_cursor_output_handle_output_commit; + output_cursor_move(output_cursor); cursor_output_cursor_update(output_cursor); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/types/wlr_input_method_v2.c new/wlroots-0.17.1/types/wlr_input_method_v2.c --- old/wlroots-0.17.0/types/wlr_input_method_v2.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/types/wlr_input_method_v2.c 2023-12-21 19:42:26.000000000 +0100 @@ -80,11 +80,17 @@ if (!input_method) { return; } + if (serial != input_method->current_serial) { + free(input_method->pending.commit_text); + free(input_method->pending.preedit.text); + input_method->pending = (struct wlr_input_method_v2_state){0}; + return; + } + free(input_method->current.commit_text); + free(input_method->current.preedit.text); input_method->current = input_method->pending; - input_method->current_serial = serial; - struct wlr_input_method_v2_state default_state = {0}; - input_method->pending = default_state; - wl_signal_emit_mutable(&input_method->events.commit, (void*)input_method); + input_method->pending = (struct wlr_input_method_v2_state){0}; + wl_signal_emit_mutable(&input_method->events.commit, input_method); } static void im_commit_string(struct wl_client *client, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/types/wlr_output_layout.c new/wlroots-0.17.1/types/wlr_output_layout.c --- old/wlroots-0.17.0/types/wlr_output_layout.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/types/wlr_output_layout.c 2023-12-21 19:42:26.000000000 +0100 @@ -106,7 +106,7 @@ static void output_update_global(struct wlr_output *output) { // Don't expose the output if it doesn't have a current mode - if (wl_list_empty(&output->modes) || output->current_mode != NULL) { + if (output->width > 0 && output->height > 0) { wlr_output_create_global(output); } else { wlr_output_destroy_global(output); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/types/wlr_viewporter.c new/wlroots-0.17.1/types/wlr_viewporter.c --- old/wlroots-0.17.0/types/wlr_viewporter.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/types/wlr_viewporter.c 2023-12-21 19:42:26.000000000 +0100 @@ -13,7 +13,7 @@ struct wlr_addon addon; - struct wl_listener surface_commit; + struct wl_listener surface_client_commit; }; static const struct wp_viewport_interface viewport_impl; @@ -112,7 +112,7 @@ wlr_addon_finish(&viewport->addon); wl_resource_set_user_data(viewport->resource, NULL); - wl_list_remove(&viewport->surface_commit.link); + wl_list_remove(&viewport->surface_client_commit.link); free(viewport); } @@ -131,27 +131,37 @@ viewport_destroy(viewport); } -static void viewport_handle_surface_commit(struct wl_listener *listener, +static bool check_src_buffer_bounds(const struct wlr_surface_state *state) { + int width = state->buffer_width / state->scale; + int height = state->buffer_height / state->scale; + if (state->transform & WL_OUTPUT_TRANSFORM_90) { + int tmp = width; + width = height; + height = tmp; + } + + struct wlr_fbox box = state->viewport.src; + return box.x + box.width <= width && box.y + box.height <= height; +} + +static void viewport_handle_surface_client_commit(struct wl_listener *listener, void *data) { struct wlr_viewport *viewport = - wl_container_of(listener, viewport, surface_commit); + wl_container_of(listener, viewport, surface_client_commit); - struct wlr_surface_state *current = &viewport->surface->pending; + struct wlr_surface_state *state = &viewport->surface->pending; - if (!current->viewport.has_dst && - (floor(current->viewport.src.width) != current->viewport.src.width || - floor(current->viewport.src.height) != current->viewport.src.height)) { + if (!state->viewport.has_dst && + (floor(state->viewport.src.width) != state->viewport.src.width || + floor(state->viewport.src.height) != state->viewport.src.height)) { wl_resource_post_error(viewport->resource, WP_VIEWPORT_ERROR_BAD_SIZE, "wl_viewport.set_source width and height must be integers " "when the destination rectangle is unset"); return; } - if (current->viewport.has_src && current->buffer != NULL && - (current->viewport.src.x + current->viewport.src.width > - current->buffer_width || - current->viewport.src.y + current->viewport.src.height > - current->buffer_height)) { + if (state->viewport.has_src && state->buffer != NULL && + !check_src_buffer_bounds(state)) { wl_resource_post_error(viewport->resource, WP_VIEWPORT_ERROR_OUT_OF_BUFFER, "source rectangle out of buffer bounds"); return; @@ -195,8 +205,8 @@ wlr_addon_init(&viewport->addon, &surface->addons, NULL, &surface_addon_impl); - viewport->surface_commit.notify = viewport_handle_surface_commit; - wl_signal_add(&surface->events.commit, &viewport->surface_commit); + viewport->surface_client_commit.notify = viewport_handle_surface_client_commit; + wl_signal_add(&surface->events.client_commit, &viewport->surface_client_commit); } static const struct wp_viewporter_interface viewporter_impl = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wlroots-0.17.0/xcursor/wlr_xcursor.c new/wlroots-0.17.1/xcursor/wlr_xcursor.c --- old/wlroots-0.17.0/xcursor/wlr_xcursor.c 2023-11-21 17:06:13.000000000 +0100 +++ new/wlroots-0.17.1/xcursor/wlr_xcursor.c 2023-12-21 19:42:26.000000000 +0100 @@ -170,10 +170,13 @@ return cursor; } +static struct wlr_xcursor *xcursor_theme_get_cursor(struct wlr_xcursor_theme *theme, + const char *name); + static void load_callback(struct xcursor_images *images, void *data) { struct wlr_xcursor_theme *theme = data; - if (wlr_xcursor_theme_get_cursor(theme, images->name)) { + if (xcursor_theme_get_cursor(theme, images->name)) { xcursor_images_destroy(images); return; }