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

Crash on startup due to mismatched DPI #1200

Closed
BreeceW opened this issue Jun 11, 2024 · 3 comments · Fixed by #1202
Closed

Crash on startup due to mismatched DPI #1200

BreeceW opened this issue Jun 11, 2024 · 3 comments · Fixed by #1202
Labels
bug Something isn't working

Comments

@BreeceW
Copy link

BreeceW commented Jun 11, 2024

Current behavior

The app will open with a blank window and then crash before loading content.

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

  1. Open DevToys-Preview from the Start menu
  2. It crashes
  3. After changing my system scaling (which is normally 125%) to 100%, it started working. On changing back to 125%, it now launches correctly.

Expected behavior

The app should launch.

Screenshots

No response

Workaround

Change DPI in system settings and back. Unclear if app needs to be launched in between changing.

Affected platforms

Windows

Affected DevToys kind

DevToys (app with GUI)

DevToys Version

Version 2.0-preview.1 | Windows 11 26100.712

Relevant Assets/Logs

Exception from Visual Studio debugger:
WebView2: Initialization failed due to a mismatch in DPI awareness. Please ensure that the DPI awareness of the host app matches the DPI awareness of current WebView2 processes using the same user data folder.

@BreeceW BreeceW added bug Something isn't working untriaged labels Jun 11, 2024
@veler veler added need more info Further information is requested and removed untriaged labels Jun 12, 2024
@veler
Copy link
Collaborator

veler commented Jun 12, 2024

Hi,
Thanks for sharing. My machine is often in 125% too and I never encountered this issue unfortunately. 🤨
I would need more data. Perhaps you can share the logs by any chance? See https://devtoys.app/doc/articles/sysadmin/logs.html?tabs=windows

@BreeceW
Copy link
Author

BreeceW commented Jun 12, 2024

Sure, this is the log from when I first ran it. log-20240203T122628.txt
When I ran it in the debugger it did not get past [1] App is starting... because it was stopping at the WebView2 initialization.
This is what the debugger output looked like. native output.txt

I’m not certain it would fix the issue, but DevToys should declare per-monitor/per-monitor v2 scaling either way. Right now, it’s running in System scaling. It looks like WPF does not respect the declaration in the .csproj file and it has to be specified in the SxS manifest.

@veler
Copy link
Collaborator

veler commented Jun 12, 2024

Indeed, at least I should add this to the manifest!

@veler veler linked a pull request Jun 12, 2024 that will close this issue
18 tasks
@veler veler removed the need more info Further information is requested label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants