Add ScreenInfo render command for desktop size synchronization

This commit is contained in:
Stone_Red
2026-06-17 01:22:15 +02:00
parent 633ded2d62
commit 5cd1f6654b
4 changed files with 33 additions and 0 deletions
+14
View File
@@ -1,3 +1,4 @@
using Cosmos.Kernel.System.Graphics;
using Cosmos.Kernel.System.Keyboard;
using RemSox.Networking;
@@ -38,6 +39,19 @@ internal sealed class RemoteDesktopProcess() : Process("Remote Desktop Server")
server.ListenTo<string>("SyncRequest", async _ =>
{
Canvas canvas = FullScreenCanvas.GetFullScreenCanvas();
RenderCommand screenInfo = new()
{
Type = RenderCommandType.ScreenInfo,
WindowId = 0,
ElementId = 0,
Properties = new()
{
["Width"] = (int)canvas.Mode.Width,
["Height"] = (int)canvas.Mode.Height,
},
};
networkSource?.Render([screenInfo]);
WindowManager.InvalidateAll();
});