From edce1fea4bc973abd398a685c63d594f7534f175 Mon Sep 17 00:00:00 2001 From: liang zhou Date: Fri, 15 May 2026 13:12:47 +0800 Subject: [PATCH] libweston: add API to get serial number from weston head Plugins need to get the serial number of the weston_head to match the touch devices. Signed-off-by: liang zhou --- include/libweston/libweston.h | 3 +++ libweston/compositor.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 1625cb49a..d97bd8399 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -2689,6 +2689,9 @@ weston_head_reset_device_changed(struct weston_head *head); const char * weston_head_get_name(struct weston_head *head); +const char * +weston_head_get_serial_number(struct weston_head *head); + struct weston_output * weston_head_get_output(struct weston_head *head); diff --git a/libweston/compositor.c b/libweston/compositor.c index d3896358b..76a4f4ed4 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -7306,6 +7306,19 @@ weston_head_get_name(struct weston_head *head) return head->name; } +/** Get the serial number of the head + * + * \param head The head to query. + * \return The serial number string, or NULL if not available. + * + * \ingroup head + */ +WL_EXPORT const char * +weston_head_get_serial_number(struct weston_head *head) +{ + return head->serial_number; +} + /** Get the output the head is attached to * * \param head The head to query.