mutter/0003-wayland-output-Set-user-data-of-xdg_output-resource.patch
2019-04-17 09:06:33 -07:00

60 lines
2.1 KiB
Diff

From b09318fd75e1d4644381e7080105da18726bbdb9 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 15 Apr 2019 14:55:45 +0200
Subject: [PATCH 3/3] wayland/output: Set user data of xdg_output resource
mutter would randomly crash in `send_xdg_output_events()` when changing
the fractional scaling:
wl_resource_post_event ()
zxdg_output_v1_send_logical_size ()
send_xdg_output_events ()
wayland_output_update_for_output ()
meta_wayland_compositor_update_outputs ()
on_monitors_changed ()
g_closure_invoke ()
signal_emit_unlocked_R ()
g_signal_emit_valist ()
_signal_emit ()
meta_monitor_manager_notify_monitors_changed ()
meta_monitor_manager_rebuild ()
This is because the xdg-output resource got freed but wasn't removed
from the list of resources.
Fix this by setting the user data of the xdg-output resource to the
corresponding `MetaWaylandOutput` so that the xdg-output resource
destructor can remove it from the list of resources.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/538
---
src/wayland/meta-wayland-outputs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index 7695d86af..099e87ab9 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -624,14 +624,14 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client *client,
wl_resource_get_version (resource),
id);
- wl_resource_set_implementation (xdg_output_resource,
- &meta_xdg_output_interface,
- NULL, meta_xdg_output_destructor);
-
wayland_output = wl_resource_get_user_data (output);
if (!wayland_output)
return;
+ wl_resource_set_implementation (xdg_output_resource,
+ &meta_xdg_output_interface,
+ wayland_output, meta_xdg_output_destructor);
+
wayland_output->xdg_output_resources =
g_list_prepend (wayland_output->xdg_output_resources, xdg_output_resource);
--
2.21.0