From c04f0c90409e9521a0870028698956bf5358d4b8 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 1 Jun 2025 23:12:30 +0200 Subject: [PATCH] New package: wl-kbptr-0.3.0 --- srcpkgs/wl-kbptr/patches/1db88d904f1.patch | 28 ++++++++++++++++++++++ srcpkgs/wl-kbptr/patches/aec15d243.patch | 26 ++++++++++++++++++++ srcpkgs/wl-kbptr/template | 14 +++++++++++ 3 files changed, 68 insertions(+) create mode 100644 srcpkgs/wl-kbptr/patches/1db88d904f1.patch create mode 100644 srcpkgs/wl-kbptr/patches/aec15d243.patch create mode 100644 srcpkgs/wl-kbptr/template diff --git a/srcpkgs/wl-kbptr/patches/1db88d904f1.patch b/srcpkgs/wl-kbptr/patches/1db88d904f1.patch new file mode 100644 index 00000000000..c77e144a82b --- /dev/null +++ b/srcpkgs/wl-kbptr/patches/1db88d904f1.patch @@ -0,0 +1,28 @@ +From 1db88d904f124636c7ade8fdd7881d0fd2d6caf1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cl=C3=A9ment=20Martinez?= +Date: Mon, 14 Apr 2025 06:48:08 +0100 +Subject: [PATCH] Don't enter first mode if layer surface not configured + +On some compositors (Niri) the `surface.enter()` is called before the +layer surface configure event is sent. This means that we don't have the +surface's dimensions, we try to enter the mode anyway, and we break. +This change prevents that. +--- + src/main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/main.c b/src/main.c +index f7bb237..81a5886 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -439,7 +439,9 @@ static void handle_surface_enter( + find_output_from_wl_output(&state->outputs, wl_output); + state->current_output = output; + +- enter_first_mode(state); ++ if (state->surface_configured) { ++ enter_first_mode(state); ++ } + } + + static const struct wl_surface_listener surface_listener = { diff --git a/srcpkgs/wl-kbptr/patches/aec15d243.patch b/srcpkgs/wl-kbptr/patches/aec15d243.patch new file mode 100644 index 00000000000..5f2e97fd7f5 --- /dev/null +++ b/srcpkgs/wl-kbptr/patches/aec15d243.patch @@ -0,0 +1,26 @@ +From aec15d243b7c19017583227de0c72c79c6e771e4 Mon Sep 17 00:00:00 2001 +From: Duncan Overbruck +Date: Sun, 1 Jun 2025 22:56:36 +0200 +Subject: [PATCH] fix memory corruption due to wrong sizeof in + label_selection_new + +--- + src/label.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/label.c b/src/label.c +index 0df5db6..b742d3c 100644 +--- a/src/label.c ++++ b/src/label.c +@@ -88,7 +88,7 @@ int label_symbols_find_idx(label_symbols_t *label_symbols, char *s) { + label_selection_t * + label_selection_new(label_symbols_t *label_symbols, int num_labels) { + label_selection_t *l = +- malloc(sizeof(label_symbols_t) + label_symbols->num_symbols); ++ malloc(sizeof(label_selection_t) + label_symbols->num_symbols); + + l->num_labels = num_labels; + +-- +2.49.0 + diff --git a/srcpkgs/wl-kbptr/template b/srcpkgs/wl-kbptr/template new file mode 100644 index 00000000000..4b52db62148 --- /dev/null +++ b/srcpkgs/wl-kbptr/template @@ -0,0 +1,14 @@ +# Template file for 'wl-kbptr' +pkgname=wl-kbptr +version=0.3.0 +revision=1 +build_style=meson +configure_args="-Dopencv=enabled" +hostmakedepends="cmake pkg-config wayland-devel" +makedepends="cairo-devel wayland-devel wayland-protocols libopencv-devel libxkbcommon-devel" +short_desc="Control the mouse pointer with the keyboard on Wayland" +maintainer="Duncaen " +license="GPL-3.0-only" +homepage="https://github.com/moverest/wl-kbptr" +distfiles="https://github.com/moverest/wl-kbptr/archive/refs/tags/v${version}.tar.gz" +checksum=69775029acb8ff7d814a2868afe22e72b8c9c99cbb35b0acf57eccd3609b089c