From 0e71aff8eab3b5e6891ef37260863b13ed9a9d4e Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 20 Jul 2022 10:24:47 -0500 Subject: [PATCH] libweston: Make weston_head_set_device_changed public Some backends have special head specific state that doesn't fit into the existing generic head setter functions, and is too specific to make more functions for. RDP's primary output flag is an example. Signed-off-by: Derek Foreman --- include/libweston/libweston.h | 3 +++ libweston/compositor.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index f3f3e85c..3087235c 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -2233,6 +2233,9 @@ weston_head_is_device_changed(struct weston_head *head); bool weston_head_is_non_desktop(struct weston_head *head); +void +weston_head_set_device_changed(struct weston_head *head); + void weston_head_reset_device_changed(struct weston_head *head); diff --git a/libweston/compositor.c b/libweston/compositor.c index 89f4c326..824d60a4 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -5775,7 +5775,23 @@ weston_head_release(struct weston_head *head) wl_list_remove(&head->compositor_link); } -static void +/** Propagate device information changes + * + * \param head The head that changed. + * + * The information about the connected display device, e.g. a monitor, may + * change without being disconnected in between. Changing information + * causes a call to the heads_changed hook. + * + * Normally this is handled automatically by the generic setters, but if + * a backend has + * specific head properties it may have to call this directly. + * + * \sa weston_head_reset_device_changed, weston_compositor_set_heads_changed_cb, + * weston_head_is_device_changed + * \ingroup head + */ +WL_EXPORT void weston_head_set_device_changed(struct weston_head *head) { head->device_changed = true;