weston: fix a touch-calibrator issue

touch-calibrator of weston 13.0.1 does not work, backport the fix from
upstream:
a5c5702112

this issue only impact weston 13.0.1, has been fixed in 14.0.1.

(From OE-Core rev: 06dcf8f45bb01fe52e16b23668c4a30d9b2d092f)

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ming Liu
2026-02-05 11:39:51 +01:00
committed by Richard Purdie
parent 7ba05c3301
commit b16633f3c6
2 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
From a5c5702112a9ccbf6abbbaac6078982f5f84bb2e Mon Sep 17 00:00:00 2001
From: Daniel Stone <daniels@collabora.com>
Date: Thu, 23 Nov 2023 16:44:10 +0000
Subject: [PATCH] touch-calibrator: Regularise surface/view mapping
Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/a5c5702112a9ccbf6abbbaac6078982f5f84bb2e]
Manually mark the surface as mapped exactly once - in the committed
handler where we have our content, and assert that it's correct when we
want to use the surface by instantiating a view.
The view handling can be made much more simple by simply using the new
view helpers.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
libweston/touch-calibration.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/libweston/touch-calibration.c b/libweston/touch-calibration.c
index 45689ddd..f4c9366a 100644
--- a/libweston/touch-calibration.c
+++ b/libweston/touch-calibration.c
@@ -189,6 +189,7 @@ map_calibrator(struct weston_touch_calibrator *calibrator)
assert(calibrator->output);
assert(calibrator->surface);
assert(calibrator->surface->resource);
+ assert(weston_surface_is_mapped(calibrator->surface));
calibrator->view = weston_view_create(calibrator->surface);
if (!calibrator->view) {
@@ -196,17 +197,9 @@ map_calibrator(struct weston_touch_calibrator *calibrator)
return;
}
- weston_layer_entry_insert(&c->calibrator_layer.view_list,
- &calibrator->view->layer_link);
-
weston_view_set_position(calibrator->view, calibrator->output->pos);
- calibrator->view->output = calibrator->surface->output;
- calibrator->view->is_mapped = true;
-
- calibrator->surface->output = calibrator->output;
- weston_surface_map(calibrator->surface);
-
- weston_output_schedule_repaint(calibrator->output);
+ weston_view_move_to_layer(calibrator->view,
+ &c->calibrator_layer.view_list);
device->ops->get_calibration(device, &device->saved_calibration);
device->ops->set_calibration(device, &identity);
@@ -260,6 +253,13 @@ touch_calibrator_surface_committed(struct wl_listener *listener, void *data)
wl_list_remove(&calibrator->surface_commit_listener.link);
wl_list_init(&calibrator->surface_commit_listener.link);
+ if (!weston_surface_has_content(surface)) {
+ wl_resource_post_error(calibrator->resource,
+ WESTON_TOUCH_CALIBRATOR_ERROR_BAD_SIZE,
+ "calibrator surface size has no content");
+ return;
+ }
+
if (surface->width != calibrator->output->width ||
surface->height != calibrator->output->height) {
wl_resource_post_error(calibrator->resource,
@@ -268,6 +268,8 @@ touch_calibrator_surface_committed(struct wl_listener *listener, void *data)
return;
}
+ weston_surface_map(surface);
+
weston_compositor_set_touch_mode_calib(calibrator->compositor);
/* results in call to touch_calibrator_mode_changed() */
}
--
2.43.0

View File

@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
SRC_URI = "https://gitlab.freedesktop.org/wayland/weston/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz \
file://0001-libweston-tools-Include-libgen.h-for-basename-signat.patch \
file://0001-vnc-Allow-neatvnc-in-version-0.8.0.patch \
file://0001-touch-calibrator-Regularise-surface-view-mapping.patch \
file://weston.png \
file://weston.desktop \
file://xwayland.weston-start \