New package: wl-kbptr-0.3.0

This commit is contained in:
Duncaen 2025-06-01 23:12:30 +02:00
parent 0ba217704d
commit c04f0c9040
No known key found for this signature in database
GPG key ID: 335C1D17EC3D6E35
3 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,28 @@
From 1db88d904f124636c7ade8fdd7881d0fd2d6caf1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Martinez?= <me@moverest.xyz>
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 = {

View file

@ -0,0 +1,26 @@
From aec15d243b7c19017583227de0c72c79c6e771e4 Mon Sep 17 00:00:00 2001
From: Duncan Overbruck <mail@duncano.de>
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

14
srcpkgs/wl-kbptr/template Normal file
View file

@ -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 <duncaen@voidlinux.org>"
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