add(core/linux/Wayland): error return when decoration manager interface is not defined
This commit is contained in:
parent
e6ba5e1461
commit
15a2cb1f0c
2 changed files with 5 additions and 0 deletions
|
|
@ -103,6 +103,7 @@ pub fn init(
|
|||
.wayland => blk: {
|
||||
const wayland = Wayland.init(linux, core, options) catch |err| {
|
||||
const err_msg = switch (err) {
|
||||
error.NoServerSideDecorationSupport => "Server Side Decorations aren't supported",
|
||||
error.LibraryNotFound => "Missing Wayland library",
|
||||
error.FailedToConnectToDisplay => "Failed to connect to Wayland display",
|
||||
else => "An unknown error occured while trying to connect to Wayland",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue