diff --git a/river/Server.zig b/river/Server.zig index 401689a..ea06842 100644 --- a/river/Server.zig +++ b/river/Server.zig @@ -19,6 +19,7 @@ const Server = @This(); const build_options = @import("build_options"); const std = @import("std"); const assert = std.debug.assert; +const mem = std.mem; const posix = std.posix; const wlr = @import("wlroots"); const wl = @import("wayland").server.wl; @@ -299,13 +300,16 @@ fn allowlist(server: *Server, global: *const wl.Global) bool { // such as wl_output and wl_seat since the wl_global_create() function will // advertise the global to clients and invoke this filter before returning // the new global pointer. - // + if ((mem.orderZ(u8, global.getInterface().name, "wl_output") == .eq) or + (mem.orderZ(u8, global.getInterface().name, "wl_seat") == .eq)) + { + return true; + } + // For other globals I like the current pointer comparison approach as it // should catch river accidentally exposing multiple copies of e.g. wl_shm // with an assertion failure. - return global.getInterface() == wl.Output.interface or - global.getInterface() == wl.Seat.interface or - global == server.shm.global or + return global == server.shm.global or global == server.single_pixel_buffer_manager.global or global == server.viewporter.global or global == server.fractional_scale_manager.global or