Skip to content

manifest support for per-monitor high DPI support#1339

Merged
mintty merged 1 commit into
mintty:masterfrom
clin1234:patch-1
Oct 20, 2025
Merged

manifest support for per-monitor high DPI support#1339
mintty merged 1 commit into
mintty:masterfrom
clin1234:patch-1

Conversation

@clin1234

Copy link
Copy Markdown
Contributor

No description provided.

@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Per-monitor support was added to the code 10 years ago and seems to be working.
What benefit would this addition to the "manifest" have?

@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Also, see function set_per_monitor_dpi_aware in winmain.c:

    HRESULT hr = pSetProcessDpiAwareness(Process_Per_Monitor_DPI_Aware);
    // E_ACCESSDENIED:
    // The DPI awareness is already set, either by calling this API previously
    // or through the application (.exe) manifest.
    if (hr != E_ACCESSDENIED && !SUCCEEDED(hr))
      pSetProcessDpiAwareness(Process_System_DPI_Aware);

This comment suggests that extending the manifest may impact mintty at runtime, so this change needs thorough testing. As I have only one monitor, I would like to ask you to do such testing and confirm everything works fine with the change.

Additional question: the API also has function SetThreadDpiAwarenessContext which is also used by mintty - how is that related?

@mintty mintty changed the title Add support for per-monitor high DPI support starting in W10 manifest support for per-monitor high DPI support Oct 18, 2025
@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Yet another question:
Another manifest (https://gist.github.com/emoacht/7e5a026080aeb7eb1b9316f5fe7628da) has extended values for both parameters. Does that mean anything?

@clin1234

Copy link
Copy Markdown
Contributor Author

Yet another question: Another manifest (https://gist.github.com/emoacht/7e5a026080aeb7eb1b9316f5fe7628da) has extended values for both parameters. Does that mean anything?

Those are fallback settings for older versions of Windows in case they don't support the newer high DPI settings

@clin1234 clin1234 closed this Oct 18, 2025
@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Thanks for considering one of my questions. I did not mean to discourage the change or urge you to close it.
I just wanted some explanation which is always useful for an issue or even pull request.

@clin1234 clin1234 reopened this Oct 18, 2025
@clin1234

Copy link
Copy Markdown
Contributor Author

Also, see function set_per_monitor_dpi_aware in winmain.c:

    HRESULT hr = pSetProcessDpiAwareness(Process_Per_Monitor_DPI_Aware);
    // E_ACCESSDENIED:
    // The DPI awareness is already set, either by calling this API previously
    // or through the application (.exe) manifest.
    if (hr != E_ACCESSDENIED && !SUCCEEDED(hr))
      pSetProcessDpiAwareness(Process_System_DPI_Aware);

This comment suggests that extending the manifest may impact mintty at runtime, so this change needs thorough testing. As I have only one monitor, I would like to ask you to do such testing and confirm everything works fine with the change.

Additional question: the API also has function SetThreadDpiAwarenessContext which is also used by mintty - how is that related?

Also, according to https://learn.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process, the manifest approach is recommended

@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

OK, but does it interact with an API handling of DPI changes?
Can you please apply the change to your own github download of mintty and test it?
Building mintty is simple: you just need packages gcc-core and make, then run make in the src subdirectory.

@clin1234

Copy link
Copy Markdown
Contributor Author

OK, but does it interact with an API handling of DPI changes? Can you please apply the change to your own github download of mintty and test it? Building mintty is simple: you just need packages gcc-core and make, then run make in the src subdirectory.

Funny; I don't have a second monitor to test this either! But after applying my changes, DPI scaling works (tested at 200% scaling)

@mintty

mintty commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Thanks so far. The most delicate question I have in mind is the test case to move a window between two monitors with different DPI setting. This should be tested by someone before committing this change which otherwise looks fine.

@mintty

mintty commented Oct 20, 2025

Copy link
Copy Markdown
Owner

I've tested this in Virtualbox with 2 virtual monitors. Merging, thank you.

@mintty mintty merged commit 0f61029 into mintty:master Oct 20, 2025
1 check passed
@clin1234 clin1234 deleted the patch-1 branch October 20, 2025 13:44
@mintty

mintty commented Feb 15, 2026

Copy link
Copy Markdown
Owner

Released 3.8.2.

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.

2 participants