Skip to content

Commit 60c4f25

Browse files
committed
Make DisplayHandle linux-specific in code
1 parent 4d74823 commit 60c4f25

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

osu.Framework/Graphics/Veldrid/VeldridDevice.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ public VeldridDevice(IGraphicsSurface graphicsSurface)
162162
{
163163
var linuxGraphics = (ILinuxGraphicsSurface)this.graphicsSurface;
164164
swapchain.Source = linuxGraphics.IsWayland
165-
? SwapchainSource.CreateWayland(this.graphicsSurface.DisplayHandle, this.graphicsSurface.WindowHandle)
166-
: SwapchainSource.CreateXlib(this.graphicsSurface.DisplayHandle, this.graphicsSurface.WindowHandle);
165+
? SwapchainSource.CreateWayland(linuxGraphics.DisplayHandle, this.graphicsSurface.WindowHandle)
166+
: SwapchainSource.CreateXlib(linuxGraphics.DisplayHandle, this.graphicsSurface.WindowHandle);
167167
break;
168168
}
169169

osu.Framework/Platform/IGraphicsSurface.cs

-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ public interface IGraphicsSurface
1616
/// </summary>
1717
IntPtr WindowHandle { get; }
1818

19-
/// <summary>
20-
/// A pointer representing a handle to the display containing this window, provided by the operating system.
21-
/// This is specific to X11/Wayland subsystems.
22-
/// </summary>
23-
IntPtr DisplayHandle { get; }
24-
2519
/// <summary>
2620
/// The type of surface.
2721
/// </summary>

osu.Framework/Platform/ILinuxGraphicsSurface.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
22
// See the LICENCE file in the repository root for full licence text.
33

4+
using System;
5+
46
namespace osu.Framework.Platform
57
{
68
public interface ILinuxGraphicsSurface
@@ -9,5 +11,11 @@ public interface ILinuxGraphicsSurface
911
/// Whether the current display server is Wayland.
1012
/// </summary>
1113
bool IsWayland { get; }
14+
15+
/// <summary>
16+
/// A pointer representing a handle to the display containing this window, provided by the operating system.
17+
/// This is specific to X11/Wayland subsystems.
18+
/// </summary>
19+
IntPtr DisplayHandle { get; }
1220
}
1321
}

osu.Framework/Platform/SDL/SDL3GraphicsSurface.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal unsafe class SDL3GraphicsSurface : IGraphicsSurface, IOpenGLGraphicsSur
2121
private IntPtr context;
2222

2323
public IntPtr WindowHandle => window.WindowHandle;
24-
public IntPtr DisplayHandle => window.DisplayHandle;
2524

2625
public GraphicsSurfaceType Type { get; }
2726

@@ -216,6 +215,9 @@ bool IOpenGLGraphicsSurface.VerticalSync
216215

217216
bool ILinuxGraphicsSurface.IsWayland => window.IsWayland;
218217

218+
[SupportedOSPlatform("linux")]
219+
IntPtr ILinuxGraphicsSurface.DisplayHandle => window.DisplayHandle;
220+
219221
#endregion
220222

221223
#region Android-specific implementation

osu.Framework/Platform/SDL3Window.cs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public IntPtr WindowHandle
120120
}
121121
}
122122

123+
[SupportedOSPlatform("linux")]
123124
public IntPtr DisplayHandle
124125
{
125126
get

0 commit comments

Comments
 (0)