diff --git a/osu.Framework/Platform/GameHost.cs b/osu.Framework/Platform/GameHost.cs index c959ffdfe6..f73e8d195d 100644 --- a/osu.Framework/Platform/GameHost.cs +++ b/osu.Framework/Platform/GameHost.cs @@ -44,6 +44,7 @@ using osu.Framework.IO.Serialization; using osu.Framework.IO.Stores; using osu.Framework.Localisation; +using Rectangle = System.Drawing.Rectangle; using Size = System.Drawing.Size; namespace osu.Framework.Platform @@ -990,6 +991,16 @@ protected void SetupRendererAndWindow(IRenderer renderer, GraphicsSurfaceType su currentDisplayMode = Window.CurrentDisplayMode.GetBoundCopy(); currentDisplayMode.BindValueChanged(_ => updateFrameSyncMode()); + Window.CurrentDisplayBindable.BindValueChanged(display => + { + if (Renderer is VeldridRenderer veldridRenderer) + { + Rectangle bounds = display.NewValue.Bounds; + + veldridRenderer.Device.UpdateActiveDisplay(bounds.X, bounds.Y, bounds.Width, bounds.Height); + } + }, true); + IsActive.BindTo(Window.IsActive); }