Skip to content

Commit

Permalink
use NativeLibrary to try loading libgamemodeauto.so.0
Browse files Browse the repository at this point in the history
this removes the reliance on path checking, instead moving it to the
(appropriate) dlopen(3) call that dotnet does under the hood. that call
loads libs based on different variables that are set by the user. thus
allowing the user to have the lib in different paths scanned by
/etc/ld.so.cache, or override it by setting LD_LIBRARY_PATH.

Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
  • Loading branch information
navi-desu committed Aug 12, 2023
1 parent 9f0f799 commit 25a7049
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public SettingsTabWine()
CheckVisibility = () => RuntimeInformation.IsOSPlatform(OSPlatform.Linux),
CheckValidity = b =>
{
if (b == true && (!File.Exists("/usr/lib/libgamemodeauto.so.0") && !File.Exists("/app/lib/libgamemodeauto.so.0")))
var handle = IntPtr.Zero;
if (b == true && !NativeLibrary.TryLoad("libgamemodeauto.so.0", out handle))
return "GameMode was not detected on your system.";
NativeLibrary.Free(handle);
return null;
}
},
Expand Down

0 comments on commit 25a7049

Please sign in to comment.