From c72ea7194e08bba42371a06e353bcd79f5a7c7cc Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 16 Aug 2020 23:21:07 +0200 Subject: [PATCH] Add RequestWindowAttention API. --- Robust.Client/Graphics/Clyde/Clyde.Windowing.cs | 5 +++++ Robust.Client/Graphics/Clyde/ClydeHeadless.cs | 5 +++++ Robust.Client/Interfaces/Graphics/IClyde.cs | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs b/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs index 75ed5cda9f..a78d7b4ec1 100644 --- a/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs +++ b/Robust.Client/Graphics/Clyde/Clyde.Windowing.cs @@ -468,6 +468,11 @@ namespace Robust.Client.Graphics.Clyde GLFW.SetWindowTitle(_glfwWindow, title); } + public void RequestWindowAttention() + { + GLFW.RequestWindowAttention(_glfwWindow); + } + public void ProcessInput(FrameEventArgs frameEventArgs) { GLFW.PollEvents(); diff --git a/Robust.Client/Graphics/Clyde/ClydeHeadless.cs b/Robust.Client/Graphics/Clyde/ClydeHeadless.cs index bfdc386ba1..c04d58f3eb 100644 --- a/Robust.Client/Graphics/Clyde/ClydeHeadless.cs +++ b/Robust.Client/Graphics/Clyde/ClydeHeadless.cs @@ -58,6 +58,11 @@ namespace Robust.Client.Graphics.Clyde // Nada. } + public void RequestWindowAttention() + { + // Nada. + } + public override bool Initialize() { return true; diff --git a/Robust.Client/Interfaces/Graphics/IClyde.cs b/Robust.Client/Interfaces/Graphics/IClyde.cs index d08765cde3..5bf8075e3a 100644 --- a/Robust.Client/Interfaces/Graphics/IClyde.cs +++ b/Robust.Client/Interfaces/Graphics/IClyde.cs @@ -14,6 +14,12 @@ namespace Robust.Client.Interfaces.Graphics Vector2i ScreenSize { get; } void SetWindowTitle(string title); + + /// + /// This is the magic method to make the game window ping you in the task bar. + /// + void RequestWindowAttention(); + event Action OnWindowResized; Texture LoadTextureFromPNGStream(Stream stream, string? name = null,