Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package slurp for openSUSE:Factory checked 
in at 2023-12-15 21:47:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/slurp (Old)
 and      /work/SRC/openSUSE:Factory/.slurp.new.25432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "slurp"

Fri Dec 15 21:47:58 2023 rev:9 rq:1133078 version:1.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/slurp/slurp.changes      2022-12-06 
14:24:27.814183475 +0100
+++ /work/SRC/openSUSE:Factory/.slurp.new.25432/slurp.changes   2023-12-15 
21:48:08.656047912 +0100
@@ -1,0 +2,9 @@
+Thu Dec 14 11:35:43 UTC 2023 - Michael Vetter <mvet...@suse.com>
+
+- Update to 1.5.0:
+  * extract cursor state initialization
+  * Implement wp_cursor_shape_v1
+  * build: move to `meson setup build` command
+  * Fix crosshair cursor is not scaled
+
+-------------------------------------------------------------------

Old:
----
  v1.4.0.tar.gz

New:
----
  v1.5.0.tar.gz

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

Other differences:
------------------
++++++ slurp.spec ++++++
--- /var/tmp/diff_new_pack.0HtVg8/_old  2023-12-15 21:48:09.512079409 +0100
+++ /var/tmp/diff_new_pack.0HtVg8/_new  2023-12-15 21:48:09.516079556 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package slurp
 #
-# 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
@@ -17,7 +17,7 @@
 
 
 Name:           slurp
-Version:        1.4.0
+Version:        1.5.0
 Release:        0
 Summary:        Wayland region selector
 License:        MIT
@@ -29,7 +29,7 @@
 BuildRequires:  scdoc
 BuildRequires:  pkgconfig(cairo)
 BuildRequires:  pkgconfig(wayland-client)
-BuildRequires:  pkgconfig(wayland-protocols) >= 1.14
+BuildRequires:  pkgconfig(wayland-protocols) >= 1.32
 BuildRequires:  pkgconfig(xkbcommon)
 
 %description

++++++ v1.4.0.tar.gz -> v1.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/.build.yml new/slurp-1.5.0/.build.yml
--- old/slurp-1.4.0/.build.yml  2022-12-05 13:02:22.000000000 +0100
+++ new/slurp-1.5.0/.build.yml  2023-12-14 11:55:54.000000000 +0100
@@ -10,7 +10,7 @@
 tasks:
   - setup: |
       cd slurp
-      meson build
+      meson setup build
   - build: |
       cd slurp
       ninja -C build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/README.md new/slurp-1.5.0/README.md
--- old/slurp-1.4.0/README.md   2022-12-05 13:02:22.000000000 +0100
+++ new/slurp-1.5.0/README.md   2023-12-14 11:55:54.000000000 +0100
@@ -1,9 +1,9 @@
 # slurp
 
 Select a region in a Wayland compositor and print it to the standard output.
-Works well with [grim](https://github.com/emersion/grim).
+Works well with [grim].
 
-Join the IRC channel: #emersion on Libera Chat.
+Join the IRC channel: [#emersion on Libera Chat][IRC].
 
 ## Building
 
@@ -18,7 +18,9 @@
 Then run:
 
 ```sh
-meson build
+git clone https://github.com/emersion/slurp
+cd slurp
+meson setup build
 ninja -C build
 build/slurp
 ```
@@ -51,11 +53,13 @@
 
 ## Contributing
 
-Either [send GitHub pull requests][1] or [send patches on the mailing list][2].
+Either [send GitHub pull requests][GitHub] or [send patches on the mailing 
list][ML].
 
 ## License
 
 MIT
 
-[1]: https://github.com/emersion/slurp
-[2]: https://lists.sr.ht/%7Eemersion/public-inbox
+[grim]: https://sr.ht/~emersion/grim/
+[IRC]: https://web.libera.chat/gamja/#emersion
+[GitHub]: https://github.com/emersion/slurp
+[ML]: https://lists.sr.ht/%7Eemersion/public-inbox
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/include/slurp.h 
new/slurp-1.5.0/include/slurp.h
--- old/slurp-1.4.0/include/slurp.h     2022-12-05 13:02:22.000000000 +0100
+++ new/slurp-1.5.0/include/slurp.h     2023-12-14 11:55:54.000000000 +0100
@@ -6,6 +6,7 @@
 #include <wayland-client.h>
 
 #include "pool-buffer.h"
+#include "cursor-shape-v1-client-protocol.h"
 #include "wlr-layer-shell-unstable-v1-client-protocol.h"
 #include "xdg-output-unstable-v1-client-protocol.h"
 
@@ -36,6 +37,7 @@
        struct wl_compositor *compositor;
        struct zwlr_layer_shell_v1 *layer_shell;
        struct zxdg_output_manager_v1 *xdg_output_manager;
+       struct wp_cursor_shape_manager_v1 *cursor_shape_manager;
        struct wl_list outputs; // slurp_output::link
        struct wl_list seats; // slurp_seat::link
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/main.c new/slurp-1.5.0/main.c
--- old/slurp-1.4.0/main.c      2022-12-05 13:02:22.000000000 +0100
+++ new/slurp-1.5.0/main.c      2023-12-14 11:55:54.000000000 +0100
@@ -156,13 +156,22 @@
 
        seat_set_outputs_dirty(seat);
 
-       wl_surface_set_buffer_scale(seat->cursor_surface, output->scale);
-       wl_surface_attach(seat->cursor_surface,
+       if (output->state->cursor_shape_manager) {
+               struct wp_cursor_shape_device_v1 *device =
+                       wp_cursor_shape_manager_v1_get_pointer(
+                               output->state->cursor_shape_manager, 
wl_pointer);
+               wp_cursor_shape_device_v1_set_shape(device, serial,
+                       WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
+               wp_cursor_shape_device_v1_destroy(device);
+       } else {
+               wl_surface_set_buffer_scale(seat->cursor_surface, 
output->scale);
+               wl_surface_attach(seat->cursor_surface,
                        wl_cursor_image_get_buffer(output->cursor_image), 0, 0);
-       wl_pointer_set_cursor(wl_pointer, serial, seat->cursor_surface,
+               wl_pointer_set_cursor(wl_pointer, serial, seat->cursor_surface,
                        output->cursor_image->hotspot_x / output->scale,
                        output->cursor_image->hotspot_y / output->scale);
-       wl_surface_commit(seat->cursor_surface);
+               wl_surface_commit(seat->cursor_surface);
+       }
 }
 
 static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
@@ -818,6 +827,45 @@
        wl_list_insert(state->boxes.prev, &b->link);
 }
 
+static bool create_cursors(struct slurp_state *state) {
+       const char *cursor_theme = getenv("XCURSOR_THEME");
+       const char *cursor_size_str = getenv("XCURSOR_SIZE");
+       int cursor_size = 24;
+       if (cursor_size_str != NULL) {
+               char *end;
+               errno = 0;
+               cursor_size = strtol(cursor_size_str, &end, 10);
+               if (errno != 0 || cursor_size_str[0] == '\0' || end[0] != '\0') 
{
+                       fprintf(stderr, "invalid XCURSOR_SIZE value\n");
+                       return false;
+               }
+       }
+
+       struct slurp_output *output;
+       wl_list_for_each(output, &state->outputs, link) {
+               output->cursor_theme = wl_cursor_theme_load(cursor_theme,
+                       cursor_size * output->scale, state->shm);
+               if (output->cursor_theme == NULL) {
+                       fprintf(stderr, "failed to load cursor theme\n");
+                       return false;
+               }
+               struct wl_cursor *cursor =
+                       wl_cursor_theme_get_cursor(output->cursor_theme, 
"crosshair");
+               if (cursor == NULL) {
+                       // Fallback
+                       cursor =
+                               
wl_cursor_theme_get_cursor(output->cursor_theme, "left_ptr");
+               }
+               if (cursor == NULL) {
+                       fprintf(stderr, "failed to load cursor\n");
+                       return false;
+               }
+               output->cursor_image = cursor->images[0];
+       }
+
+       return true;
+}
+
 int main(int argc, char *argv[]) {
        int status = EXIT_SUCCESS;
 
@@ -967,19 +1015,6 @@
                return EXIT_FAILURE;
        }
 
-       const char *cursor_theme = getenv("XCURSOR_THEME");
-       const char *cursor_size_str = getenv("XCURSOR_SIZE");
-       int cursor_size = 24;
-       if (cursor_size_str != NULL) {
-               char *end;
-               errno = 0;
-               cursor_size = strtol(cursor_size_str, &end, 10);
-               if (errno != 0 || cursor_size_str[0] == '\0' || end[0] != '\0') 
{
-                       fprintf(stderr, "invalid XCURSOR_SIZE value\n");
-                       return EXIT_FAILURE;
-               }
-       }
-
        struct slurp_output *output;
        wl_list_for_each(output, &state.outputs, link) {
                output->surface = 
wl_compositor_create_surface(state.compositor);
@@ -1011,29 +1046,14 @@
                
zwlr_layer_surface_v1_set_keyboard_interactivity(output->layer_surface, true);
                zwlr_layer_surface_v1_set_exclusive_zone(output->layer_surface, 
-1);
                wl_surface_commit(output->surface);
-
-               output->cursor_theme = wl_cursor_theme_load(cursor_theme,
-                       cursor_size * output->scale, state.shm);
-               if (output->cursor_theme == NULL) {
-                       fprintf(stderr, "failed to load cursor theme\n");
-                       return EXIT_FAILURE;
-               }
-               struct wl_cursor *cursor =
-                       wl_cursor_theme_get_cursor(output->cursor_theme, 
"crosshair");
-               if (cursor == NULL) {
-                       // Fallback
-                       cursor =
-                               
wl_cursor_theme_get_cursor(output->cursor_theme, "left_ptr");
-               }
-               if (cursor == NULL) {
-                       fprintf(stderr, "failed to load cursor\n");
-                       return EXIT_FAILURE;
-               }
-               output->cursor_image = cursor->images[0];
        }
        // second roundtrip for xdg-output
        wl_display_roundtrip(state.display);
 
+       if (!state.cursor_shape_manager && !create_cursors(&state)) {
+               return EXIT_FAILURE;
+       }
+
        if (output_boxes) {
                struct slurp_output *box_output;
                wl_list_for_each(box_output, &state.outputs, link) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/meson.build new/slurp-1.5.0/meson.build
--- old/slurp-1.4.0/meson.build 2022-12-05 13:02:22.000000000 +0100
+++ new/slurp-1.5.0/meson.build 2023-12-14 11:55:54.000000000 +0100
@@ -1,7 +1,7 @@
 project(
        'slurp',
        'c',
-       version: '1.4.0',
+       version: '1.5.0',
        license: 'MIT',
        meson_version: '>=0.59.0',
        default_options: ['c_std=c11', 'warning_level=2', 'werror=true'],
@@ -15,7 +15,7 @@
 realtime = cc.find_library('rt')
 wayland_client = dependency('wayland-client')
 wayland_cursor = dependency('wayland-cursor')
-wayland_protos = dependency('wayland-protocols', version: '>=1.14')
+wayland_protos = dependency('wayland-protocols', version: '>=1.32')
 xkbcommon = dependency('xkbcommon')
 
 subdir('protocol')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/slurp-1.4.0/protocol/meson.build 
new/slurp-1.5.0/protocol/meson.build
--- old/slurp-1.4.0/protocol/meson.build        2022-12-05 13:02:22.000000000 
+0100
+++ new/slurp-1.5.0/protocol/meson.build        2023-12-14 11:55:54.000000000 
+0100
@@ -17,6 +17,8 @@
 
 client_protocols = [
        wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml',
+       wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml',
+       wl_protocol_dir / 'unstable/tablet/tablet-unstable-v2.xml',
        wl_protocol_dir / 'unstable/xdg-output/xdg-output-unstable-v1.xml',
        'wlr-layer-shell-unstable-v1.xml',
 ]

Reply via email to