0
0
Fork 0

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.
This commit is contained in:
Mary 2021-05-07 18:37:48 +02:00 committed by GitHub
parent 7aed7808be
commit acb1647c86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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