Explorar o código

Fix embedded game rendering (#2275)

This fix an issue when after a relaunch of a game containing other
games (embedded games), the renderer window size would be 1x1.

This bug was introduced by #2260.
Mary %!s(int64=5) %!d(string=hai) anos
pai
achega
acb1647c86
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      Ryujinx/Ui/RendererWidgetBase.cs

+ 8 - 1
Ryujinx/Ui/RendererWidgetBase.cs

@@ -64,6 +64,9 @@ namespace Ryujinx.Ui
         private GraphicsDebugLevel _glLogLevel;
         private string _gpuVendorName;
 
+        private int _windowHeight;
+        private int _windowWidth;
+
         public RendererWidgetBase(InputManager inputManager, GraphicsDebugLevel glLogLevel)
         {
             _inputManager = inputManager;
@@ -225,7 +228,10 @@ namespace Ryujinx.Ui
 
             Gdk.Monitor monitor = Display.GetMonitorAtWindow(Window);
 
-            Renderer?.Window.SetSize(evnt.Width * monitor.ScaleFactor, evnt.Height * monitor.ScaleFactor);
+            _windowWidth = evnt.Width * monitor.ScaleFactor;
+            _windowHeight = evnt.Height * monitor.ScaleFactor;
+
+            Renderer?.Window.SetSize(_windowWidth, _windowHeight);
 
             return result;
         }
@@ -293,6 +299,7 @@ namespace Ryujinx.Ui
         {
             Device = device;
             Renderer = Device.Gpu.Renderer;
+            Renderer?.Window.SetSize(_windowWidth, _windowHeight);
         }
 
         public void Render()