Skip to content

Commit 8296e3d

Browse files
authored
Update WindowAlwaysOnTop.cs
1 parent d92e853 commit 8296e3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Assets/Scripts/Helpers/Windows/WindowAlwaysOnTop.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace UnityLibrary
88
{
99
public class WindowAlwaysOnTop : MonoBehaviour
1010
{
11+
#if !UNITY_STANDALONE_LINUX
12+
1113
// https://stackoverflow.com/a/34703664/5452781
1214
private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
1315
private const UInt32 SWP_NOSIZE = 0x0001;
@@ -26,11 +28,12 @@ public static IntPtr GetWindowHandle()
2628
{
2729
return GetActiveWindow();
2830
}
31+
#endif
2932

3033
void Awake()
3134
{
3235
// TODO save current window pos to player prefs on exit, then can open into same position next time
33-
#if !UNITY_EDITOR
36+
#if !UNITY_EDITOR && !UNITY_STANDALONE_LINUX
3437
Debug.Log("Make window stay on top");
3538
SetWindowPos(GetActiveWindow(), HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);
3639
#endif

0 commit comments

Comments
 (0)