Package: cage
Severity: normal
Tags: patch upstream

Dear Maintainer,

wl_touch::frame() is expected to be sent to client to indicate end of
touch frame event and not sending it may cause issues.
For example, Qt applications using Qt Wayland platform plugin do not
consider touch events until this end of frame to be received.

This problem is solved by upstream in commit:
https://github.com/cage-kiosk/cage/commit/7ec7e3df2bfc2069219285ccca676327480fa471

The buttons in my Qt application can not be clicked using touchscreen with version in bookworm repository. After applied this patch, problem
solved.


-- System Information:
Debian Release: 12.7
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 6.1.0-25-amd64 (SMP w/28 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_USER, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cage depends on:
ii libc6 2.36-9+deb12u8
ii libpixman-1-0 0.42.2-1
ii libwayland-server0 1.21.0-1
pn libwlroots10 <none>
ii libxkbcommon0 1.5.0-1

cage recommends no packages.

cage suggests no packages.
From 7ec7e3df2bfc2069219285ccca676327480fa471 Mon Sep 17 00:00:00 2001
From: Jonathan GUILLOT <jonat...@joggee.fr>
Date: Wed, 23 Aug 2023 18:40:15 +0200
Subject: [PATCH] seat: add missing touch_frame handler

wl_touch::frame() is expected to be sent to client to indicate end of
touch frame event and not sending it may cause issues.
For example, Qt applications using Qt Wayland platform plugin do not
consider touch events until this end of frame to be received.
---
 seat.c | 12 ++++++++++++
 seat.h |  1 +
 2 files changed, 13 insertions(+)

diff --git a/seat.c b/seat.c
index 5d80e33..80fd86a 100644
--- a/seat.c
+++ b/seat.c
@@ -565,6 +565,15 @@ handle_touch_motion(struct wl_listener *listener, void *data)
 	wlr_idle_notify_activity(seat->server->idle, seat->seat);
 }
 
+static void
+handle_touch_frame(struct wl_listener *listener, void *data)
+{
+	struct cg_seat *seat = wl_container_of(listener, seat, touch_frame);
+
+	wlr_seat_touch_notify_frame(seat->seat);
+	wlr_idle_notify_activity(seat->server->idle, seat->seat);
+}
+
 static void
 handle_cursor_frame(struct wl_listener *listener, void *data)
 {
@@ -748,6 +757,7 @@ handle_destroy(struct wl_listener *listener, void *data)
 	wl_list_remove(&seat->touch_down.link);
 	wl_list_remove(&seat->touch_up.link);
 	wl_list_remove(&seat->touch_motion.link);
+	wl_list_remove(&seat->touch_frame.link);
 	wl_list_remove(&seat->request_set_cursor.link);
 	wl_list_remove(&seat->request_set_selection.link);
 	wl_list_remove(&seat->request_set_primary_selection.link);
@@ -830,6 +840,8 @@ seat_create(struct cg_server *server, struct wlr_backend *backend)
 	wl_signal_add(&seat->cursor->events.touch_up, &seat->touch_up);
 	seat->touch_motion.notify = handle_touch_motion;
 	wl_signal_add(&seat->cursor->events.touch_motion, &seat->touch_motion);
+	seat->touch_frame.notify = handle_touch_frame;
+	wl_signal_add(&seat->cursor->events.touch_frame, &seat->touch_frame);
 
 	seat->request_set_cursor.notify = handle_request_set_cursor;
 	wl_signal_add(&seat->seat->events.request_set_cursor, &seat->request_set_cursor);
diff --git a/seat.h b/seat.h
index 52cbee4..19ed936 100644
--- a/seat.h
+++ b/seat.h
@@ -39,6 +39,7 @@ struct cg_seat {
 	struct wl_listener touch_down;
 	struct wl_listener touch_up;
 	struct wl_listener touch_motion;
+	struct wl_listener touch_frame;
 
 	struct wl_list drag_icons;
 	struct wl_listener request_start_drag;

Reply via email to