Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New templates cause blurred / low-res look on Windows when using other than 100% display scaling settings #330

Closed
MinikPLayer opened this issue Apr 17, 2023 · 5 comments

Comments

@MinikPLayer
Copy link

MinikPLayer commented Apr 17, 2023

Current behavior

When using unoapp template from Uno.Templates or Visual Studio template wizard resulting Windows app is blurred / low-res looking if system display scaling is other than 100%.

(screenshot showing Uno.Templates unoapp window in the background, and native looking, not blurred window in the foreground)
image

Expected behavior

App correctly scaling with display scaling

How to reproduce it (as minimally and precisely as possible)

Follow getting started guide (for example https://platform.uno/docs/articles/get-started-vs-2022.html) and set display scaling to 150% or 200%. App should be blurry.

Workaround

Use Rider Getting Started guide (https://platform.uno/docs/articles/get-started-rider.html?tabs=windows). App won't be blury in legacy template used in this guide.

EDIT:
Changing <Manifest Include="$(ApplicationManifest)" /> to <Manifest Include="app.manifest" />, <WindowsAppSDKSelfContained> to true and deleting UnoApp.Windows/obj directory also works.
(See comment #330)

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.WinUI: 4.8.24

Affected platforms

Windows

IDE

Visual Studio 2022

IDE version

17.5.4

Relevant plugins

No response

Anything else we need to know?

Windows 11 22H2
AMD 23.4.2 driver

@MinikPLayer
Copy link
Author

MinikPLayer commented Apr 20, 2023

Tested also on fresh Windows 11 and Windows 10 installations following the guide on https://platform.uno/docs/articles/get-started-vs-2022.html
The same thing happens

@MinikPLayer
Copy link
Author

MinikPLayer commented Apr 23, 2023

Update: If built using "unpackaged" option and then run with "Override DPI scaling" in compatibility settings set to "Application" scaling works as intended (high-res, sharp). So it looks like this problem is probably caused by the app not telling the OS that it's able to scale itself.

@MinikPLayer
Copy link
Author

MinikPLayer commented Apr 23, 2023

Update: I was able to track down a potential cause of this problem.
WinUI app.manifest containing dpiAwareness settings are not being added to the solution with <Manifest Include="$(ApplicationManifest)" /> because $(ApplicationManifest) points to UnoApp.Windows\obj\x64\Debug\net7.0-windows10.0.19041.0\win10-x64\Manifests\app.manifest that doesn't contain elements from UnoApp.Windows\app.manifest including dpiAwareness, so resulting app is treated as not DPI aware.
In plain WinUI $(ApplicationManifest) value is just app.manifest.

Replacing <Manifest Include="$(ApplicationManifest)" /> with <Manifest Include="app.manifest" /> fixes the issue (but i don't think this is the right solution).

EDIT:
Works only after setting <WindowsAppSDKSelfContained> to true (even when Package deploy setting is selected) and removing UnoApp.Windows/obj directory if it already exist.

@jeromelaban jeromelaban self-assigned this Apr 24, 2023
@jeromelaban jeromelaban transferred this issue from unoplatform/uno Apr 24, 2023
@jeromelaban jeromelaban assigned dansiegel and unassigned jeromelaban Apr 24, 2023
@dansiegel
Copy link
Contributor

I believe this was fixed already by @MartinZikmund in unoplatform/uno.templates#44

@MartinZikmund
Copy link
Member

Yes, that should fix the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants