mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
wayland/output: Always set xdg_output interface implementation
This avoids the following crash, that could happen in certain rare race conditions, e.g. in tests: 0) wl_closure_invoke (closure=0x2fbf9e0, target=0x2e5b3d0, opcode=0) at ../src/connection.c:1014 1) wl_client_connection_data () at ../src/wayland-server.c:432 2) wl_event_loop_dispatch () at ../src/event-loop.c:1027 3) wayland_event_source_dispatch () at ../src/wayland/meta-wayland.c:104 4) g_main_dispatch () at ../glib/gmain.c:3381 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2127>
This commit is contained in:
parent
50ccab567f
commit
7b83735aea
@ -646,24 +646,25 @@ meta_xdg_output_manager_get_xdg_output (struct wl_client *client,
|
||||
id);
|
||||
|
||||
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);
|
||||
|
||||
if (!wayland_output)
|
||||
goto done;
|
||||
|
||||
wayland_output->xdg_output_resources =
|
||||
g_list_prepend (wayland_output->xdg_output_resources, xdg_output_resource);
|
||||
|
||||
if (!wayland_output->monitor)
|
||||
return;
|
||||
goto done;
|
||||
|
||||
send_xdg_output_events (xdg_output_resource,
|
||||
wayland_output,
|
||||
wayland_output->monitor,
|
||||
TRUE, NULL);
|
||||
|
||||
done:
|
||||
xdg_output_version = wl_resource_get_version (xdg_output_resource);
|
||||
wl_output_version = wl_resource_get_version (output);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user