-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent compositor blocking on linux
- Loading branch information
Showing
5 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Intersect.Client.Core/MonoGame/NativeInterop/Sdl2.Hints.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
|
||
namespace Intersect.Client.MonoGame.NativeInterop; | ||
|
||
public partial class Sdl2 | ||
{ | ||
public const string SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"; | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
public unsafe delegate int SDL_SetHint_d(byte* name, byte* value); | ||
|
||
private static SDL_SetHint_d SDL_SetHint_f = Loader.Functions.LoadFunction<SDL_SetHint_d>(nameof(SDL_SetHint)); | ||
|
||
public static unsafe bool SDL_SetHint(string name, string value) | ||
{ | ||
fixed (byte* pValue = Encoding.UTF8.GetBytes(value)) | ||
{ | ||
fixed (byte* pName = Encoding.UTF8.GetBytes(name)) | ||
{ | ||
return SDL_SetHint_f(pName, pValue) != 0; | ||
} | ||
} | ||
} | ||
|
||
public static bool SDL_SetHint(string name, bool value) => SDL_SetHint(name, value ? "1" : "0"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters