Skip to content

wayland/outputs: Fix potential crash when output has no monitor

Ghost User requested to merge (removed):fix-wayland-outputs-crash into main

bind_output() creates output interface resource, but does not set implementation for it when wayland_output->monitor is NULL. However, when the wayland library is running wl_closure_invoke(), it expects the implementation to be non-NULL, and if not, it just segfaults mutter by NULL pointer dereference.

This commit tries to address this issue by setting an implementation when wayland_output->monitor is NULL. This could help prevent crash when resuming from suspend or hotplugging displays.

Fixes #2570 (closed).

Merge request reports