From d5081e3f93a3283ca7e73358d24d76d110ea962f Mon Sep 17 00:00:00 2001 From: sharmander <saldabain.dev@gmail.com> Date: Fri, 19 Feb 2021 19:34:41 -0500 Subject: Make windows DPI aware to display properly on high-resolution screens. (#1983) * Make Windows DPI aware to display properly on high-resolution screens. * remove empty line * Don't use app manifest, set process dpi aware programatically. Store variables in Program.cs for use instead of re-creating them per class/ method. * Fix for linux/osx * Add braces * Re-use manifest. It appears to be required on linux. * Undo previous commit -- it appears linux was simply never affected. * Addressed AcK's comments * Remove unused usings * Address comments by AcK #2 * Re-order * Move FromHwnd call to ForceDpiAware class. Wrap in Try-Catch to prevent crashes on systems that don't support it. * Additional code cleanup * Remove "global::" reference. --- Ryujinx/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Ryujinx/Program.cs') diff --git a/Ryujinx/Program.cs b/Ryujinx/Program.cs index c6d3b1bd..5d50e9d2 100644 --- a/Ryujinx/Program.cs +++ b/Ryujinx/Program.cs @@ -18,12 +18,14 @@ namespace Ryujinx { class Program { + public static double WindowScaleFactor { get; private set; } + public static string Version { get; private set; } public static string ConfigurationPath { get; set; } static void Main(string[] args) - { + { // Parse Arguments. string launchPathArg = null; string baseDirPathArg = null; @@ -54,6 +56,10 @@ namespace Ryujinx } } + // Make process DPI aware for proper window sizing on high-res screens. + ForceDpiAware.Windows(); + WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); + // Delete backup files after updating. Task.Run(Updater.CleanupUpdate); -- cgit v1.2.3-70-g09d2