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

Add DPI-Aware Manifests for High DPI Support #664

Merged
merged 1 commit into from
Dec 16, 2014

Conversation

jimnoble
Copy link
Contributor

@jimnoble jimnoble commented Dec 4, 2014

add dpi-aware manifest to BrowserSubprocess and WinForms.Example
projects
update .gitignore to allow .manifest files

add dpi-aware manifest to BrowserSubprocess and WinForms.Example
projects
update .gitignore to allow .manifest files
@amaitland
Copy link
Member

What exactly is a dpi-aware manifest? What purposes does it serve for the BrowserSubprocess?

@jimnoble
Copy link
Contributor Author

jimnoble commented Dec 4, 2014

An app.manifest file provides extra information about an application that the compiler integrates into the executable. This file is XML and can be both added to a project with and edited with Visual Studio.

Historically, this was most used to inform Windows that an EXE requires elevated permissions (usually requiring a UAC prompt when the EXE is run).

More recently, an option was added to the newest app.manifest schema that will inform Windows that your application is 'DPI Aware'. With this flag on, the application will be allowed to draw its own high resolution imagery, instead of being automatically (and poorly) upsampled by Windows to match the current zoom level. See http://stackoverflow.com/questions/13448180/how-do-i-enable-dpiaware

This app.manifest is required to be integrated into the executable of every process that supports high DPI. So in the case of CefSharp, this is the WinForms example, but also the BrowserSubprocess exe as well. Without the manifest applied both to the BrowserSubprocess and the consuming app, the browser process will not draw high DPI properly.

I have verified this on the main CEF forum: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=12366 Once this is fully resolved with CefSharp I will respond there with success.

@amaitland
Copy link
Member

Appreciate the detailed description 👍

@amaitland
Copy link
Member

I'll have a read over the links you provided. The app.manifest formatting with a line break between each element seems a little odd. Was the file generated by some sort of tooling?

@jimnoble
Copy link
Contributor Author

jimnoble commented Dec 5, 2014

I format *ML that way out of habit for readability. You can feel free to remove the breaks.

@amaitland
Copy link
Member

Were you able to get things running locally to confirm this works?

@jimnoble
Copy link
Contributor Author

jimnoble commented Dec 5, 2014

No, I am still having the issue described in #628

I have my own application where I have followed these steps (including adding the app.manifest to the browserprocess proj) to success, but as stated, cefsharp and its example doesn't work 'out of the box' for me right now and I don't know why.

Do you know what might cause the errors it puts in the log file? Particularly:
[1203/205835:ERROR:gpu_process_transport_factory.cc(402)] Failed to establish GPU channel.
[1203/205835:VERBOSE1:webrtc_internals.cc(50)] Could not get the download directory.

@amaitland
Copy link
Member

I'm not sure, I've personally never seen that problem before.

Operating System
x86 or x64?
Debug or Release
Visual Studio Version?

@jimnoble
Copy link
Contributor Author

jimnoble commented Dec 5, 2014

Windows 8.1 64 bit, Visual Studio 2013 Update 4, Solution set to Debug / Win32..

But nevermind all of that, I just ran it again and I guess my computer shook off the dust because it works great now :)

Here is a screenshot of the winforms example running in beautiful 200% DPI (probably flippin huge on a normal-DPI display): http://screencast.com/t/C1JbhmJK

@amaitland
Copy link
Member

Nice 👍

@bjarteskogoy
Copy link

Maybe this would eliminate the need for #619 ? Have you tested this with WPF too?

@jimnoble
Copy link
Contributor Author

jimnoble commented Dec 7, 2014

@bjarteskogoy I did not alter the WPF aspect since I am not familiar enough with WPF that I know what is required for high DPI support. It may well be the exact same solution.

You could try pulling my branch, adding a manifest to the WPF example (right click project, add item..., search for 'app manifest'), and copying the contents from one of the other two app.manifests (the content is the same).

@amaitland I am still working off of my own branch until this is integrated. Anything I can do to help merge this pull req?

@amaitland
Copy link
Member

@jimnoble I noticed both app.manifests have the following line

<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />

Need to update the name for each project and also look at having the build.ps1 script update the version number.

@amaitland amaitland added this to the 37.0.0 milestone Dec 11, 2014
amaitland added a commit that referenced this pull request Dec 16, 2014
Add DPI-Aware Manifests for High DPI Support
@amaitland amaitland merged commit 997e7ed into cefsharp:master Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants