summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2019-09-03 13:46:37 +0200
committerJonas Ã…dahl <jadahl@gmail.com>2019-09-05 07:29:10 +0000
commitbe4131b3c487e6bc1d89286207f8a52a4fb62ec8 (patch)
tree41e7cff0afb8aae4e7bb27a61a06bd43b2d68a7f
parent854feafa83591a74f05584b6a3e41ce42dc6151d (diff)
downloadmutter-be4131b3c487e6bc1d89286207f8a52a4fb62ec8.tar.gz
wayland/xdg-output: Fix xdg-output v3 support
When using xdg-output v3 or later, the Wayland compositor does not send xdg_output.done events which are deprecated. Instead, it should send a wl_output.done event for the matching wl_output. https://gitlab.gnome.org/GNOME/mutter/merge_requests/771
-rw-r--r--src/wayland/meta-wayland-outputs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index fdbf01688..f4709caef 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -624,12 +624,6 @@ send_xdg_output_events (struct wl_resource *resource,
zxdg_output_v1_send_description (resource, description);
}
- if (need_all_events && version < NO_XDG_OUTPUT_DONE_SINCE_VERSION)
- {
- zxdg_output_v1_send_done (resource);
- need_done = FALSE;
- }
-
if (pending_done_event && need_done)
*pending_done_event = TRUE;
}
@@ -642,6 +636,8 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client *client,
{
struct wl_resource *xdg_output_resource;
MetaWaylandOutput *wayland_output;
+ int xdg_output_version;
+ int wl_output_version;
xdg_output_resource = wl_resource_create (client,
&zxdg_output_v1_interface,
@@ -666,6 +662,14 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client *client,
wayland_output,
wayland_output->logical_monitor,
TRUE, NULL);
+
+ xdg_output_version = wl_resource_get_version (xdg_output_resource);
+ wl_output_version = wl_resource_get_version (output);
+
+ if (xdg_output_version < NO_XDG_OUTPUT_DONE_SINCE_VERSION)
+ zxdg_output_v1_send_done (xdg_output_resource);
+ else if (wl_output_version >= WL_OUTPUT_DONE_SINCE_VERSION)
+ wl_output_send_done (output);
}
static void