Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package slurp for openSUSE:Factory checked in at 2021-04-19 21:06:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/slurp (Old) and /work/SRC/openSUSE:Factory/.slurp.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "slurp" Mon Apr 19 21:06:28 2021 rev:7 rq:886685 version:1.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/slurp/slurp.changes 2020-11-05 21:56:34.295961368 +0100 +++ /work/SRC/openSUSE:Factory/.slurp.new.12324/slurp.changes 2021-04-19 21:06:58.632117331 +0200 @@ -1,0 +2,7 @@ +Mon Apr 19 12:06:19 UTC 2021 - Michael Vetter <mvet...@suse.com> + +- Update to 1.3.2: + * Fix incorrect anchor when output has negative position + * Fix loss of selection when pointer moves between outputs + +------------------------------------------------------------------- Old: ---- v1.3.1.tar.gz New: ---- v1.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ slurp.spec ++++++ --- /var/tmp/diff_new_pack.jccceo/_old 2021-04-19 21:06:59.120118063 +0200 +++ /var/tmp/diff_new_pack.jccceo/_new 2021-04-19 21:06:59.124118068 +0200 @@ -1,7 +1,7 @@ # # spec file for package slurp # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 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.3.1 +Version: 1.3.2 Release: 0 Summary: Wayland region selector License: MIT ++++++ v1.3.1.tar.gz -> v1.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/slurp-1.3.1/main.c new/slurp-1.3.2/main.c --- old/slurp-1.3.1/main.c 2020-11-05 12:19:37.000000000 +0100 +++ new/slurp-1.3.2/main.c 2021-04-17 19:39:34.000000000 +0200 @@ -45,10 +45,6 @@ return (a < b) ? a : b; } -static int max(int a, int b) { - return (a > b) ? a : b; -} - static struct slurp_output *output_from_surface(struct slurp_state *state, struct wl_surface *surface); @@ -100,6 +96,18 @@ } } +static void handle_active_selection_motion(struct slurp_seat *seat, struct slurp_selection *current_selection) { + int32_t anchor_x = current_selection->anchor_x; + int32_t anchor_y = current_selection->anchor_y; + current_selection->selection.x = min(anchor_x, current_selection->x); + current_selection->selection.y = min(anchor_y, current_selection->y); + // selection includes the seat and anchor positions + current_selection->selection.width = + abs(current_selection->x - anchor_x) + 1; + current_selection->selection.height = + abs(current_selection->y - anchor_y) + 1; +} + static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) { @@ -112,7 +120,16 @@ seat->pointer_selection.current_output = output; move_seat(seat, surface_x, surface_y, &seat->pointer_selection); - seat_update_selection(seat); + + switch (seat->button_state) { + case WL_POINTER_BUTTON_STATE_RELEASED: + seat_update_selection(seat); + break; + case WL_POINTER_BUTTON_STATE_PRESSED:; + handle_active_selection_motion(seat, &seat->pointer_selection); + break; + } + seat_set_outputs_dirty(seat); wl_surface_set_buffer_scale(seat->cursor_surface, output->scale); @@ -132,18 +149,6 @@ seat->pointer_selection.current_output = NULL; } -static void handle_active_selection_motion(struct slurp_seat *seat, struct slurp_selection *current_selection) { - int32_t anchor_x = max(0, current_selection->anchor_x); - int32_t anchor_y = max(0, current_selection->anchor_y); - current_selection->selection.x = min(anchor_x, current_selection->x); - current_selection->selection.y = min(anchor_y, current_selection->y); - // selection includes the seat and anchor positions - current_selection->selection.width = - abs(current_selection->x - anchor_x) + 1; - current_selection->selection.height = - abs(current_selection->y - anchor_y) + 1; -} - static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) { struct slurp_seat *seat = data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/slurp-1.3.1/meson.build new/slurp-1.3.2/meson.build --- old/slurp-1.3.1/meson.build 2020-11-05 12:19:37.000000000 +0100 +++ new/slurp-1.3.2/meson.build 2021-04-17 19:39:34.000000000 +0200 @@ -1,14 +1,10 @@ project( - 'slurp', - 'c', - version: '1.3.0', - license: 'MIT', - meson_version: '>=0.48.0', - default_options: [ - 'c_std=c11', - 'warning_level=2', - 'werror=true', - ], + 'slurp', + 'c', +version : '1.3.2', +license : 'MIT', +meson_version : '>=0.48.0', +default_options : ['c_std=c11', 'warning_level=2', 'werror=true'] ) add_project_arguments('-Wno-unused-parameter', language: 'c')