[mutter/gnome-41] backend: Return NULL cursor renderer if there is no seat

commit 53b1ad28ce20e007a6a57b5d0c920dda3a9cf3fc
Author: Jonas Ådahl <jadahl gmail com>
Date:   Thu Dec 9 11:11:24 2021 +0100

    backend: Return NULL cursor renderer if there is no seat
    During tear down, if anything teared down after the seat tries to get
    the cursor renderer, we'd crash trying to get it as the seat would
    already be gone. Avoid this by returning NULL when there is no seat.
    It's assumed that any path that will happen during tear down that relies
    on getting the cursor renderer will gracefully handle it not being
    present, e.g. by relying on the cursor rendering cleaning up itself.
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2147>
    (cherry picked from commit ada524265fdcae827d67191b47e4c128c08c9d8f)

 src/backends/meta-backend.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index f4fceeb4ee..87e0b3bba1 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -1226,6 +1226,9 @@ meta_backend_get_cursor_renderer (MetaBackend *backend)
   MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
   ClutterInputDevice *pointer;
+  if (!priv->default_seat)
+    return NULL;
   pointer = clutter_seat_get_pointer (priv->default_seat);
   return meta_backend_get_cursor_renderer_for_device (backend, pointer);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]