add(core/linux/Wayland): error return when decoration manager interface is not defined

This commit is contained in:
Ronald M Zielaznicki 2024-10-24 23:59:23 -04:00 committed by Stephen Gutekanst
parent e6ba5e1461
commit 15a2cb1f0c
2 changed files with 5 additions and 0 deletions

View file

@ -118,6 +118,10 @@ pub fn init(
//Round trip to get all initial output events
_ = wl.libwaylandclient.wl_display_roundtrip(wl.display);
if (wl.interfaces.zxdg_decoration_manager_v1 == null) {
return error.NoServerSideDecorationSupport;
}
//Setup surface
wl.surface = c.wl_compositor_create_surface(wl.interfaces.wl_compositor) orelse return error.UnableToCreateSurface;
wl.surface_descriptor = try options.allocator.create(gpu.Surface.DescriptorFromWaylandSurface);