aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Bolhuis <mark@bolhuis.dev>2022-08-13 22:59:11 +0200
committerSimon Ser <contact@emersion.fr>2022-08-19 14:22:23 +0000
commit9ab819684d41b5052260e11a337ce0cdee6ce3bd (patch)
treec1f6e1144107b49f976577d3c9e3b7b45ca16c1f
parent346e52420171cedaf1fb7dffe7e37f99b478c5b1 (diff)
types/wlr_xdg_output_v1: Fix wl_output.done bug.
If the client binds to version 3 of zxdg_output_v1 and version 1 of wl_output no wl_output.done or zxdg_output_v1.done event is emitted [1]. Also no wl_output.done event is emitted when version 2 or lower of zxdg_output_v1 is bound to. Add a version check to output_manager_handle_get_xdg_output so that no wl_output.done event is emitted when using version 1 of wl_output and version 2 or lower of zxdg_output_v1. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/81
-rw-r--r--types/wlr_xdg_output_v1.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/types/wlr_xdg_output_v1.c b/types/wlr_xdg_output_v1.c
index 062bf6e6..d030748d 100644
--- a/types/wlr_xdg_output_v1.c
+++ b/types/wlr_xdg_output_v1.c
@@ -127,11 +127,11 @@ static void output_manager_handle_get_xdg_output(struct wl_client *client,
wl_resource_get_link(xdg_output_resource));
// Name and description should only be sent once per output
- uint32_t version = wl_resource_get_version(xdg_output_resource);
- if (version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) {
+ uint32_t xdg_version = wl_resource_get_version(xdg_output_resource);
+ if (xdg_version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) {
zxdg_output_v1_send_name(xdg_output_resource, output->name);
}
- if (version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION &&
+ if (xdg_version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION &&
output->description != NULL) {
zxdg_output_v1_send_description(xdg_output_resource,
output->description);
@@ -139,7 +139,11 @@ static void output_manager_handle_get_xdg_output(struct wl_client *client,
output_send_details(xdg_output, xdg_output_resource);
- wl_output_send_done(output_resource);
+ uint32_t wl_version = wl_resource_get_version(output_resource);
+ if (wl_version >= WL_OUTPUT_DONE_SINCE_VERSION &&
+ xdg_version >= OUTPUT_DONE_DEPRECATED_SINCE_VERSION) {
+ wl_output_send_done(output_resource);
+ }
}
static const struct zxdg_output_manager_v1_interface