Skip to content

Commit

Permalink
gamemode: revert commit 41ddd22 for gamescope.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-holmes committed Jan 4, 2025
1 parent 1d01c91 commit 5902a78
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/gamemode.zig
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const std = @import("std");
const builtin = @import("builtin");
const mach = @import("main.zig");

const log = std.log.scoped(.gamemode);

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) {
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down

0 comments on commit 5902a78

Please sign in to comment.