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

Not using high DPI #49

Open
chris-morgan opened this issue Jan 22, 2019 · 6 comments
Open

Not using high DPI #49

chris-morgan opened this issue Jan 22, 2019 · 6 comments

Comments

@chris-morgan
Copy link

I don’t know exactly where the fault may be, but when I run the examples they’re all low DPI on my 200% scaling factor Windows device. I know that Sciter itself must be capable of running high-DPI, because I tried out the HTML Notepad app and it’s scaled properly.

@pravic
Copy link
Member

pravic commented Jan 22, 2019

@chris-morgan
Copy link
Author

Yeah, that’d do it. My understanding from a couple of projects in the past that have spent quite a bit of effort on optimal high-DPI support is that for best compatibility DLL calls are preferred to manifests—​to say nothing of manifests not fitting particularly well into Rust’s compilation model at present.

@pravic
Copy link
Member

pravic commented Jan 23, 2019

Sounds reasonable. Are you talking about SetThreadDpiAwarenessContext & K°?

Though it'd be better to have such a function in the Sciter API rather than in each binding. But we can do it here as well.

@chris-morgan
Copy link
Author

I don’t recall which precise DLL calls were involved, but that looks about right (though I’ve never seen it done at the thread level, only the process level). I recall compatibility across multiple versions of Windows (e.g. trying DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 first, then DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, then DPI_AWARENESS_CONTEXT_SYSTEM_AWARE, or something) being a little fiddly.

@chris-morgan
Copy link
Author

winit is the primary experience I’ve had of being involved with high-quality and high-compatibility DPI awareness: it started in rust-windowing/winit#332 for Windows, and ended up landing in rust-windowing/winit#548.

The current code for it on Windows is in src/platform/windows/dpi.rs: I expect that to be a very useful resource. (See also the shared file src/dpi.rs.)

@pravic
Copy link
Member

pravic commented Jan 23, 2019

Yes, there is a group of them:

SetThreadDpiAwarenessContext is for Windows 10 1607 or higher
SetProcessDpiAwarenessContext is for 1703 at least
SetThreadDpiHostingBehavior is for 1803

Anyway, thanks for pointing this out. I'll try to come up with something. Ideally, this should be enabled by default with an option to opt out.

And thanks for the links, they are very thorough.

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

No branches or pull requests

2 participants