Giter Site home page Giter Site logo

Not using high DPI about rust-sciter HOT 6 OPEN

chris-morgan avatar chris-morgan commented on September 12, 2024
Not using high DPI

from rust-sciter.

Comments (6)

pravic avatar pravic commented on September 12, 2024

This could be the answer: https://github.com/c-smile/sciter-sdk/blob/master/demos/usciter/win-res/dpi-aware.manifest

from rust-sciter.

chris-morgan avatar chris-morgan commented on September 12, 2024

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.

from rust-sciter.

pravic avatar pravic commented on September 12, 2024

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.

from rust-sciter.

chris-morgan avatar chris-morgan commented on September 12, 2024

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.

from rust-sciter.

chris-morgan avatar chris-morgan commented on September 12, 2024

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.)

from rust-sciter.

pravic avatar pravic commented on September 12, 2024

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.

from rust-sciter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.