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.
This commit is contained in:
sharmander 2021-02-19 19:34:41 -05:00 committed by GitHub
parent 65eb9901f1
commit d5081e3f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 4 deletions

View file

@ -1113,7 +1113,10 @@ namespace Ryujinx.Ui
private void Settings_Pressed(object sender, EventArgs args)
{
new SettingsWindow(this, _virtualFileSystem, _contentManager).Show();
SettingsWindow settingsWindow = new SettingsWindow(this, _virtualFileSystem, _contentManager);
settingsWindow.SetSizeRequest((int)(settingsWindow.DefaultWidth * Program.WindowScaleFactor), (int)(settingsWindow.DefaultHeight * Program.WindowScaleFactor));
settingsWindow.Show();
}
private void Simulate_WakeUp_Message_Pressed(object sender, EventArgs args)
@ -1134,7 +1137,10 @@ namespace Ryujinx.Ui
private void About_Pressed(object sender, EventArgs args)
{
new AboutWindow().Show();
AboutWindow aboutWindow = new AboutWindow();
aboutWindow.SetSizeRequest((int)(aboutWindow.DefaultWidth * Program.WindowScaleFactor), (int)(aboutWindow.DefaultHeight * Program.WindowScaleFactor));
aboutWindow.Show();
}
private void Fav_Toggled(object sender, EventArgs args)