kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0001-wayland-No-xdg-output-events-without-a-logical-monit.patch

776610
From 6ed36cd6e36e9bd15ae4ca39f5b8163c4740c484 Mon Sep 17 00:00:00 2001
776610
From: Olivier Fourdan <ofourdan@redhat.com>
776610
Date: Tue, 25 Sep 2018 13:50:09 +0200
776610
Subject: [PATCH] wayland: No xdg-output events without a logical monitor
776610
776610
To avoid a known race condition in the wl_output protocol documented in
776610
https://phabricator.freedesktop.org/T7722, mutter delays the `wl_output`
776610
destruction but nullify the `logical_monitor` associated with the
776610
`wl_output` and the binding routine `bind_output()` makes sure not to
776610
send wl_output events if the `logical_monitor` is `NULL` (see commit
776610
1923db97).
776610
776610
The binding routine for `xdg_output` however does not check for such a
776610
condition, hence if the output configuration changes while a client is
776610
binding to xdg-output (typically Xwayland at startup), mutter would
776610
crash while trying to access the `logical_monitor` which was nullified
776610
by the change in configuration.
776610
776610
Just like `bind_output()` does for wl_output, do not send xdg-output
776610
events if there is no `logical_monitor` yet.
776610
776610
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194
776610
776610
(cherry picked from commit 68ec9ac017157def9b7c25dd8141dc0e93d9f918)
776610
---
776610
 src/wayland/meta-wayland-outputs.c | 3 +++
776610
 1 file changed, 3 insertions(+)
776610
776610
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
776610
index bc67b90be..1f99a163d 100644
776610
--- a/src/wayland/meta-wayland-outputs.c
776610
+++ b/src/wayland/meta-wayland-outputs.c
776610
@@ -592,6 +592,9 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client   *client,
776610
   wayland_output->xdg_output_resources =
776610
     g_list_prepend (wayland_output->xdg_output_resources, xdg_output_resource);
776610
 
776610
+  if (!wayland_output->logical_monitor)
776610
+    return;
776610
+
776610
   send_xdg_output_events (xdg_output_resource,
776610
                           wayland_output,
776610
                           wayland_output->logical_monitor,
776610
-- 
776610
2.19.0
776610