Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ END TEMPLATE-->
### New features

* Add a BoundUserInterfaceMessageReceivedEvent that will be raised whenever a BoundUserInterfaceMessage is received regardless of validation.
* Added WindowGetMonitor API for getting the current IClydeMonitor.

### Bugfixes

Expand Down
8 changes: 8 additions & 0 deletions Robust.Client/Graphics/Clyde/Clyde.Windowing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ public void SetWindowMonitor(IClydeMonitor monitor)
_windowing!.WindowSetMonitor(_mainWindow!, monitor);
}

public IClydeMonitor? GetWindowMonitor()
{
DebugTools.AssertNotNull(_windowing);
DebugTools.AssertNotNull(_mainWindow);

return _windowing!.WindowGetMonitor(_mainWindow!);
}

public void RequestWindowAttention()
{
DebugTools.AssertNotNull(_windowing);
Expand Down
5 changes: 5 additions & 0 deletions Robust.Client/Graphics/Clyde/ClydeHeadless.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public void SetWindowMonitor(IClydeMonitor monitor)
// Nada.
}

public IClydeMonitor? GetWindowMonitor()
{
return null;
}

public void RequestWindowAttention()
{
// Nada.
Expand Down
1 change: 1 addition & 0 deletions Robust.Client/Graphics/Clyde/Windowing/IWindowingImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private interface IWindowingImpl
void WindowDestroy(WindowReg reg);
void WindowSetTitle(WindowReg window, string title);
void WindowSetMonitor(WindowReg window, IClydeMonitor monitor);
IClydeMonitor? WindowGetMonitor(WindowReg window);
void WindowSetSize(WindowReg window, Vector2i size);
void WindowSetVisible(WindowReg window, bool visible);
void WindowRequestAttention(WindowReg window);
Expand Down
8 changes: 8 additions & 0 deletions Robust.Client/Graphics/Clyde/Windowing/Sdl3.Window.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
Expand Down Expand Up @@ -426,6 +427,13 @@ public void WindowSetMonitor(WindowReg window, IClydeMonitor monitor)
_sawmill.Warning("WindowSetMonitor not implemented on SDL3");
}

public IClydeMonitor? WindowGetMonitor(WindowReg window)
{
var displayId = SDL.SDL_GetDisplayForWindow(WinPtr(window));
var monitorId = GetMonitorIdFromDisplayId(displayId);
return _clyde._monitorHandles.GetValueOrDefault(monitorId);
}

public void WindowSetSize(WindowReg window, Vector2i size)
{
SendCmd(new CmdWinSetSize { Window = WinPtr(window), W = size.X, H = size.Y });
Expand Down
5 changes: 5 additions & 0 deletions Robust.Client/Graphics/IClyde.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public interface IClyde
void SetWindowTitle(string title);
void SetWindowMonitor(IClydeMonitor monitor);

/// <summary>
/// Gets the monitor the main game window is currently on.
/// </summary>
IClydeMonitor? GetWindowMonitor();

/// <summary>
/// This is the magic method to make the game window ping you in the task bar.
/// </summary>
Expand Down
Loading