diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2018-09-25 13:50:09 +0200 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2019-01-14 10:06:45 -0500 |
commit | e00d6c6273c1f432fc97b9ab67a5fe9af1fa20fa (patch) | |
tree | 23c17e9bc7ee115952c08639024424a621819204 | |
parent | 733ab3b2bc34fac013d2a6e5b81443b7046acae9 (diff) | |
download | mutter-e00d6c6273c1f432fc97b9ab67a5fe9af1fa20fa.tar.gz |
wayland: No xdg-output events without a logical monitor
To avoid a known race condition in the wl_output protocol documented in
https://phabricator.freedesktop.org/T7722, mutter delays the `wl_output`
destruction but nullify the `logical_monitor` associated with the
`wl_output` and the binding routine `bind_output()` makes sure not to
send wl_output events if the `logical_monitor` is `NULL` (see commit
1923db97).
The binding routine for `xdg_output` however does not check for such a
condition, hence if the output configuration changes while a client is
binding to xdg-output (typically Xwayland at startup), mutter would
crash while trying to access the `logical_monitor` which was nullified
by the change in configuration.
Just like `bind_output()` does for wl_output, do not send xdg-output
events if there is no `logical_monitor` yet.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194
(cherry picked from commit 68ec9ac017157def9b7c25dd8141dc0e93d9f918)
-rw-r--r-- | src/wayland/meta-wayland-outputs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index bc67b90be..1f99a163d 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -592,6 +592,9 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client *client, wayland_output->xdg_output_resources = g_list_prepend (wayland_output->xdg_output_resources, xdg_output_resource); + if (!wayland_output->logical_monitor) + return; + send_xdg_output_events (xdg_output_resource, wayland_output, wayland_output->logical_monitor, |