diff options
| author | Alberto Fanjul <albertofanjul@gmail.com> | 2022-11-17 13:02:43 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-17 13:02:43 +0100 |
| commit | 55043c8afcf3803b091c2770d7f528bbeb238f68 (patch) | |
| tree | 4436c0ead1f5f0da06ecc15c7de894a15d6eba2d | |
| parent | 5d73a9f5fce23b030821f5fb2d71855099f14ec2 (diff) | |
Allow to start Ryujinx in wayland environment (#3516)
PrimaryMonitor is only available on X11
At some point it will be deprecated, this change support wayland
| -rw-r--r-- | Ryujinx/Ui/MainWindow.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 802a86ec..3f261f4d 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -148,10 +148,10 @@ namespace Ryujinx.Ui // Apply custom theme if needed. ThemeHelper.ApplyTheme(); - + Gdk.Monitor monitor = Display.GetMonitor(0); // Sets overridden fields. - int monitorWidth = Display.PrimaryMonitor.Geometry.Width * Display.PrimaryMonitor.ScaleFactor; - int monitorHeight = Display.PrimaryMonitor.Geometry.Height * Display.PrimaryMonitor.ScaleFactor; + int monitorWidth = monitor.Geometry.Width * monitor.ScaleFactor; + int monitorHeight = monitor.Geometry.Height * monitor.ScaleFactor; DefaultWidth = monitorWidth < 1280 ? monitorWidth : 1280; DefaultHeight = monitorHeight < 760 ? monitorHeight : 760; |
