GithubHelp home page GithubHelp logo

Comments (1)

pthom avatar pthom commented on June 15, 2024

Hi,

I cannot reproduce the issue on my side.

You told me that calling SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); seems to fix the issue.

Can you confirm whether modifying hello_imgui/src/hello_imgui/internal/backend_impls/backend_window_helper/win32_dpi_awareness.cpp like this (removing two return) does solve the issue for you?

    // Helper function to enable DPI awareness without setting up a manifest
    void ImGui_ImplWin32_EnableDpiAwareness()
    {
        // Make sure monitors will be updated with latest correct scaling
        // if (ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData())
        //    bd->WantUpdateMonitors = true;

        if (_IsWindows10OrGreater())
        {
            static HINSTANCE user32_dll = ::LoadLibraryA("user32.dll");  // Reference counted per-process
            if (PFN_SetThreadDpiAwarenessContext SetThreadDpiAwarenessContextFn =
                    (PFN_SetThreadDpiAwarenessContext)::GetProcAddress(user32_dll,
                                                                       "SetThreadDpiAwarenessContext"))
            {
                SetThreadDpiAwarenessContextFn(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
                return;      //         REMOVE THIS RETURN
            }
        }
        if (_IsWindows8Point1OrGreater())
        {
            static HINSTANCE shcore_dll = ::LoadLibraryA("shcore.dll");  // Reference counted per-process
            if (PFN_SetProcessDpiAwareness SetProcessDpiAwarenessFn =
                    (PFN_SetProcessDpiAwareness)::GetProcAddress(shcore_dll, "SetProcessDpiAwareness"))
            {
                SetProcessDpiAwarenessFn(PROCESS_PER_MONITOR_DPI_AWARE);
                return;      //         REMOVE THIS RETURN ??
            }
        }
#if _WIN32_WINNT >= 0x0600
        ::SetProcessDPIAware();
#endif
    }

from hello_imgui.

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.