Classic Shell
http://classicshell.net/forum/

Windows 8.1 and Windows 10 Per-Monitor-DPI
http://classicshell.net/forum/viewtopic.php?f=13&t=5310
Page 1 of 1

Author:  llcepick [ Wed Oct 28, 2015 11:52 am ]
Post subject:  Windows 8.1 and Windows 10 Per-Monitor-DPI  Topic is solved

The biggest problem is that I have multiple monitors with mixed UHD and HD resolutions - including 192DPI, 144DPI and 96DPI monitors - and the start menu is not sized correctly when using the start button on the individual monitors.

Windows 10 adds a slider (per monitor) that allows the UI to be scaled via the system - which makes it easier to test an implementation with non UHD monitors (install two 1600x1200 monitors - and set one to 200% - only in Windows 10).

Here is the link to look at about get the Start Menu implemented with Per-Monitor-DPI awareness.

https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx

Author:  Ivo [ Wed Oct 28, 2015 8:44 pm ]
Post subject:  Re: Widnows 8.1 and Windows 10 Per-Monitor-DPI

There are 3 problems here:
1) The start menu runs inside Explorer, therefore it depends if the Explorer process is multi-DPI aware or not. I have to check
2) The start menu only has one set of small and one set of large icons and their sizes are determined at startup. It is not possible to use different size icons for each monitor
3) The font sizes and the skin element sizes are determined when the skin is loaded. If you keep switching monitors the skin has to be reloaded

Out of those, only #3 is something that can be done, and even then there is some performance cost for reloading the skin. The menu may open slower if you switch monitors

Author:  Gaurav [ Wed Oct 28, 2015 11:36 pm ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

Explorer.exe seems to have DPI aware manifest and on Windows 10, Microsoft made changes to Explorer to scale per-monitor (dynamic scaling): https://blogs.technet.microsoft.com/ask ... indows-10/

Author:  llcepick [ Thu Oct 29, 2015 8:40 am ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

Windows Explorer actually has many more sizes for all of its icons - the limit is with using SHGetFileInfo - where it only has small and large flag - I am using an alternate API which allows me to ask the OS for pixel sizes - so I can get the icons to use at sizes I want to use.

When there is not a larger size, I use Windows Imaging (WIX) to scale the icon bitmaps to the size required. I actually use the 256x256 size of an ICO to generate all intermediate sizes below using the FANT filter of WIX.

Author:  llcepick [ Thu Oct 29, 2015 8:49 am ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

For the skins problem:

Fonts - the sizes provided can be considered for 96DPI - and use nNewFontSize=MulDiv(nFontSize,nMonitorDpi,96); to get the per-monitor font size.
Images/graphics - do not worry about having exact sizes for every DPI - instead use WIX to scale (FANT for going down in size, CUBIC for going up)

Also, only activate this code path if the user has a multiple-monitor system with monitors that have different DPI - this can avoid memory over-use.

Author:  Ivo [ Thu Oct 29, 2015 9:21 am ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

I am not talking about Explorer or SHGetFileInfo. I am talking about the internal cache stored by the start menu and saved to disk. It does not support arbitrary number of sizes. Particularly because icons are mostly preloaded, they would have to be preloaded at many different sizes because I don't know what DPI will be used when you open the menu next. That adds overhead to both performance and code complexity.

I know how to scale fonts. The problem is that to create an HFONT you need to give it actual pixel size. If the next time the DPI is different, a new font needs to be created. Same for skin elements. Some skins contain bitmaps to be used for high DPI values. At the time of loading the skin the correct bitmap is chosen based on the DPI and the rest are discarded. If the next time the DPI is different, the skin must be loaded again.

Author:  Gaurav [ Tue Nov 17, 2015 4:33 am ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

@llcepick, try Classic Shell 4.2.5. It supports per-monitor DPI. The text and menu elements are scaled independently for each monitor. The icon size depends on the global system DPI.

Author:  llcepick [ Wed Jun 08, 2016 5:10 am ]
Post subject:  Re: Windows 8.1 and Windows 10 Per-Monitor-DPI

I have been using it for a while now... This is working so much nicer. Thanks!

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/