It is currently March 28th, 2024, 12:48 pm

Rainmeter and DPI in Windows 10

Tips and Tricks from the Rainmeter Community
Post Reply
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Rainmeter and DPI in Windows 10

Post by jsmorley »

While this isn't going to go into all the ins and outs of how DPI (Dots Per Inch) works in Windows 10 , I did want to address one facet of it that can impact Rainmeter.
Dots per inch (DPI)) is the physical measurement of number of pixels in a linear inch of a display. DPI is a function of display resolution and size; a higher resolution or a smaller size will lead to higher DPI, and a lower resolution or a larger size will lead to lower DPI. When a display has a higher DPI, pixels are smaller and closer together, so that the user interface (UI) and other displayed content appears smaller than intended.

Windows ensures that everything appears on the screen at a usable and consistent size by instructing applications (including the Windows desktop shell) to resize their content by a scale factor. This number depends on the display DPI as well as other factors that impact the user’s perception of the display. Almost all desktop displays and most current laptop displays are in the range of 95-110 DPI; for these devices, no scaling is required, and Windows sets a scale factor of 100%. However, there are a number of new devices, particularly in the premium laptop and tablet markets, which have higher displays with over 200 DPI. For these devices, Windows sets higher scale factors to ensure that the user experience is comfortably viewable.

When you change the DPI scaling level for your displays, it changes the size of text, apps and other items to appear larger or smaller. A higher DPI level has everything appear larger, and a lower DPI level has everything appear smaller.

The default DPI level is 100% (96 DPI).
If Windows has automatically set the DPI level to 125%, which it may do on some high-resolution monitors, laptops and tablets, or if you prefer the 125% DPI level and set it manually, Rainmeter will obey that setting like any other Windows application.

However, that may not be what you want. Most of the skins you might download and use were almost certainly designed with a DPI setting of 100% (96 DPI) in mind. They may display much larger than the author intended, and not fit where they used to, and may be somewhat "pixelated" and ugly.

What you might want is to allow Windows (the Windows interface elements and application windows) to be at the 125% or even larger value, but have Rainmeter use 100% (96 DPI) for its skins. You can do that.

The setting for DPI is done in the Setting panels in Windows. Here we are set to 125%, which we want.
DPI1.jpg
To change Rainmeter to ignore this and use 100% DPI, find the "shortcut" for Rainmeter, which you will find in your Startup folder in Windows:
DPI2.jpg
Right-click that shortcut, and select "Properties". Under Properties, select the "Compatibility" tab, and do this:

1.jpg

2.jpg


Restart Rainmeter using the shortcut.

Note that there are a couple of places in Rainmeter that won't be effected by this, since they are things that are not actually created and rendered by Rainmeter, but by Windows itself. These are the FontSize in InputText fields, and the size of context menus in skins. These will always use the DPI setting in Windows.
Borck
Posts: 3
Joined: January 29th, 2016, 2:23 pm

Re: Rainmeter and DPI in Windows 10

Post by Borck »

I implemented a rainmeter skin which supports HiDPI:
http://fav.me/d9hqg96
socrates
Posts: 3
Joined: September 17th, 2017, 11:39 pm

Re: Rainmeter and DPI in Windows 10

Post by socrates »

Thanks mate, this helped a lot. I've just posted this issue in the help section.
I have a dpi scaling of 150%, use a 80" TV as a HTPC monitor from about 8 feet away.
phcreery
Posts: 1
Joined: October 9th, 2018, 10:09 pm

Re: Rainmeter and DPI in Windows 10

Post by phcreery »

I have Microsoft Surface Pro 4 and default scaling is 200% and this trick worked perfectly.
You can also change it by:
Right Clicking C:\Program Files\Rainmeter\Rainmeter.exe > Properties > Compatability > etc
User avatar
Cariboudjan
Posts: 260
Joined: May 12th, 2019, 8:55 am

Re: Rainmeter and DPI in Windows 10

Post by Cariboudjan »

Made up this little trick to fix over-sized font when using InputText fields in Rainmeter.

Code: Select all

[Variables]
InputSize=18

[MeasureRegistry]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Control Panel\Desktop\WindowMetrics
RegValue=AppliedDPI
UpdateDivider=-1

[InputTextFontSize]
Measure=Calc
Formula=((#InputSize#-(((#InputSize#*(((ROUND(([MeasureRegistry]/100)/0.25)))*0.25))-#InputSize#)/2))-((#InputSize#-(((#InputSize#*(((ROUND(([MeasureRegistry]/100)/0.25)))*0.25))-#InputSize#)/2))%1))
DynamicVariables=1
Last edited by Cariboudjan on June 6th, 2021, 8:35 pm, edited 1 time in total.
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Rainmeter and DPI in Windows 10

Post by Jeff »

-snip-
It's super effective!
Last edited by Jeff on June 4th, 2021, 1:55 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter and DPI in Windows 10

Post by jsmorley »

Jeff wrote: June 4th, 2021, 12:22 pm https://i.imgur.com/SqmR5mw.png
Sorry for the spam but can you please update Proprieties image so we don't get questions like these anymore, maybe have both images and say that one is for older versions of Windows and the other one is for newer versions (and in the image of the newer version show both the button and the option you need to change, maybe something like this)
I'll delete this post in 24 hours (if it dosen't get deleted manually by a dev), just sending a temporary reminder of sorts for this forum post to get updated
I updated the images in the first post. I actually don't give two hoots about folks that don't stay current with the release versions of Windows 10.
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Rainmeter and DPI in Windows 10

Post by Jeff »

Thank you very much
jsmorley wrote: June 4th, 2021, 12:29 pm I actually don't give two hoots about folks that don't stay current with the release versions of Windows 10.
That's... uhhh... hmmm... it's an effective way to put it, this message dosen't convey how up-to-date the statement is since a few revisions ago you guys fixed Insiders builds (from the fuuuuture)
I'm going off too much, thanks for the change though!
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Rainmeter and DPI in Windows 10

Post by Jeff »

For some reason I feel obliged to add something useful here after using snip
For devs that are annoyed that this needs to be done manually, you can make a skin that's just

Code: Select all

[Rainmeter]
OnRefreshAction=["""reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "#PROGRAMPATH#Rainmeter.exe" /t "REG_SZ" /d "~ HIGHDPIAWARE""""][!DeactivateConfig]
to basically do what the iamges from the first post are doing, after that, just tell the users to restart Rainmeter
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter and DPI in Windows 10

Post by jsmorley »

Jeff wrote: June 4th, 2021, 2:31 pm For some reason I feel obliged to add something useful here after using snip
For devs that are annoyed that this needs to be done manually, you can make a skin that's just

Code: Select all

[Rainmeter]
OnRefreshAction=["""reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "#PROGRAMPATH#Rainmeter.exe" /t "REG_SZ" /d "~ HIGHDPIAWARE""""][!DeactivateConfig]
to basically do what the iamges from the first post are doing, after that, just tell the users to restart Rainmeter
I'm loath in the extreme to ever suggest that folks write to their Windows Registry with Rainmeter. To each his own of course.
Post Reply