From 377842aef80ab4d87c220c2b2eefca3c4dd45ee0 Mon Sep 17 00:00:00 2001 From: Joshua Holmes Date: Sat, 4 Jan 2025 00:57:13 +0000 Subject: [PATCH] gamemode: revert commit 41ddd22 for gamescope.zig --- src/gamemode.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gamemode.zig b/src/gamemode.zig index af251414..928d55a1 100644 --- a/src/gamemode.zig +++ b/src/gamemode.zig @@ -1,6 +1,5 @@ const std = @import("std"); const builtin = @import("builtin"); -const mach = @import("main.zig"); const log = std.log.scoped(.gamemode); @@ -8,7 +7,7 @@ test { std.testing.refAllDeclsRecursive(@This()); } -pub const LoadError = error{ MissingSymbol, LibraryNotFound } || std.DynLib.Error; +pub const LoadError = error{MissingSymbol} || std.DynLib.Error; pub const Error = error{ RequestFailed, RequestRejected }; pub const Status = enum(u8) { @@ -101,9 +100,9 @@ const linux_impl = struct { pub fn tryInit() LoadError!void { if (state == .init) return; - var dl = mach.dynLibOpen("libgamemode.so.0") catch |e| switch (e) { + var dl = std.DynLib.open("libgamemode.so.0") catch |e| switch (e) { // backwards-compatibility for old gamemode versions - error.LibraryNotFound => try mach.dynLibOpen("libgamemode.so"), + error.FileNotFound => try std.DynLib.open("libgamemode.so"), else => return e, }; errdefer dl.close(); @@ -129,7 +128,7 @@ const linux_impl = struct { .failed => return false, .uninit => { tryInit() catch |e| { - if (e != error.LibraryNotFound) { + if (e != error.FileNotFound) { log.warn("Loading gamemode: '{}'. Disabling libgamemode support.", .{e}); } state = .failed;