core: use MACH_BACKEND instead of MACH_CORE_BACKEND env var for selecting linux backend

This commit is contained in:
Joshua Holmes 2024-10-10 21:05:36 -07:00 committed by Stephen Gutekanst
parent fd04c039c9
commit ea3c520eae

View file

@ -66,7 +66,7 @@ pub fn init(
const desired_backend: BackendEnum = blk: { const desired_backend: BackendEnum = blk: {
const backend = std.process.getEnvVarOwned( const backend = std.process.getEnvVarOwned(
linux.allocator, linux.allocator,
"MACH_CORE_BACKEND", "MACH_BACKEND",
) catch |err| switch (err) { ) catch |err| switch (err) {
error.EnvironmentVariableNotFound => { error.EnvironmentVariableNotFound => {
break :blk .wayland; break :blk .wayland;
@ -77,7 +77,7 @@ pub fn init(
if (std.ascii.eqlIgnoreCase(backend, "x11")) break :blk .x11; if (std.ascii.eqlIgnoreCase(backend, "x11")) break :blk .x11;
if (std.ascii.eqlIgnoreCase(backend, "wayland")) break :blk .wayland; if (std.ascii.eqlIgnoreCase(backend, "wayland")) break :blk .wayland;
std.debug.panic("mach: unknown MACH_CORE_BACKEND: {s}", .{backend}); std.debug.panic("mach: unknown MACH_BACKEND: {s}", .{backend});
}; };
// Try to initialize the desired backend, falling back to the other if that one is not supported // Try to initialize the desired backend, falling back to the other if that one is not supported