Sublime Forum

Dev 3158/3159 high DPI not working? (Win10)

#1

I just installed the Dev 3159. Before that, all works quite well. Now, the font becomes extremely large without changing anything.

Since my laptop has a high resolution, I scaled up to 250% long time ago, and everything works pretty good. Though Dev 3158/3159 add support for high DPI, but things seem become bad.

Can anyone give me a suggestion. Thanks.

0 Likes

#2

Did you set "dpi_scale": 2.5 for scaling?

Maybe this is no longer needed.

With dpi_scale not being present in the user settings and a font_size of 11 ST3159 scales exactly the same way like all the other windows and icons/controls in real time.

Which Windows 10 build do you use? I guess the real support for the API being used for scaling is fully supported since 1607 or 1703.

0 Likes

#3

My win10 is build 10240, which is a little bit old. The funny thing is that high DPI not working any more after Dev 3158 add high DPI support.

0 Likes

#4

Please post the Sublime Text Console contents from a fresh start. It will include info about the DPI mode that was detected.

0 Likes

#5
DPI mode: system
DPI scale: 2.5
startup, version: 3160 windows x64 channel: dev
executable: /C/Program Files/Sublime Text 3/sublime_text.exe

This is the info in the console. The global setting of my win system is 250% scalling. When sublime check my DPI scale is 2.5, it scales 2.5 times. So, I think the ST actual scales 6.25 = 2.5*2.5.

0 Likes

#6

This old built misses most of the HiDPI features and API’s, comes with some experimental features about that, only.

If I were you, I’d update to a more recent Windows built, especially as the support for these “old” builts was dropped anyway.

0 Likes

#7

This is odd. We enable per-monitor high dpi featured via an app manifest. This is the Microsoft approved way to to support Windows 8.1+. Windows 8.1 is where per-monitor DPI support was added.

Since your machine is using the system DPI mode means it is dropping back to the Windows Vista/7/8 mode, which is strange.

0 Likes

#8

Is there a way to set “DPI scale” manually? thanks.
I think manually DPI scale setting should be help.

0 Likes

#9

That is controlled via the "dpi_scale" setting in the preferences, although I’d kind of like to figure out why your Windows 10 machine isn’t being picked up as capable of per-window DPI.

0 Likes

#10

Thanks. When I changed dpi_scale to 1.5, the font size returns to normal. However, the console still shows DPI scale: 2.5 no matter how I change this in the Settings. Maybe this wired thing happens because my Win system version is too old. Anyway, it can works now. Thank you.

0 Likes

#11

From what I read in technet and some blogs, the per monitor and per window HIDPI APIs are really supported starting with Win10 1607.

see: https://blogs.windows.com/buildingapps/2017/04/04/high-dpi-scaling-improvements-desktop-applications-windows-10-creators-update/

… In the Anniversary Update we introduced a new DPI awareness tag, . …

In short, the manifest keys you use to control DPI awareness are not supported by Windows 8, 81, 10 (1507/1511).

Therefore the API falls back to default mode.

0 Likes

#12

The article you linked two indicated that per-monitor v2 was added in build 1703, but if you look at https://msdn.microsoft.com/en-us/library/windows/desktop/mt843498(v=vs.85).aspx you’ll see per-monitor was introduced in 8.1.

Windows 10 1607 added some APIs, but we don’t need most of them since we do the drawing ourself, grab the dpi scale when the WM_DPICHANGED is sent, and use the manifest.

We do support per-monitor with NC scaling with per-monitor V1 for Windows 10 1607 (https://msdn.microsoft.com/en-us/library/windows/desktop/mt748621(v=vs.85).aspx). However, per-monitor without NC scaling is done for 8.1+.

During development I tested the changes on 8.1 and confirmed that per-monitor was working there. You’ll see info in the console as to what dpi mode is enabled. It will be one of:

  • DPI mode: per-monitor v2 (Windows 10 1703)
  • DPI mode: per-monitor (w/ non-client) (Windows 10 1607)
  • DPI mode: per-monitor (Windows 8.1)
  • DPI mode: system (Windows Vista)
  • DPI mode: none (XP)
0 Likes

#13

The docs are indeed a bit tricky to read out which kinds of behavior or level of supported functionality to expect from which version.

With your listing about dpi-modes the main question seems to be why DPI mode: system is used on the Windows 10 box of @E81kfzuIkvPU?

Shouldn’t it use DPI mode: per-monitor?

0 Likes

#14

Not sure if I should make a new topic about this, but I have similar odd behaviour on my system.

I’m running Windows 10 pro (1709) and Sublime, Dev channel, Build 3160. I have two panels of the same physical size; one 1080p and one 4k. To make things obvious, I’ve set the 4k panel to 200% scaling in the Windows settings.

My user settings are relatively minimal. Font-size set to 12 and no dpi_scaling set (although I had that set to 1.5 prior to updating to 3160).

This is what the console shows on startup:
DPI mode: per-monitor (w/ non-client) startup, version: 3160 windows x64 channel: dev executable: /C/Program Files/Sublime Text 3/sublime_text.exe

A previous post above says DPI mode should be per-monitor v2, but that’s not the case on my machine.

Anyway. The odd behaviour is that Sublime opens up in a set scaling and doesn’t change when moved between my panels. That set scaling, however, acts erratically. I have Sublime pinned to my task bar (which is shown on both my displays). If I open Sublime by clicking on the pinned icon on my 1080p panel, it opens at the small size (my guess is dpi_scaling 1.0). If I open Sublime by clicking the pinned icon on the 4k display, it opens in a large size (dpi_scaling 2.0). The same goes if I open Sublime using the start menu on the respective panel.

This behaviour persists regardless of if I exit Sublime on either screen (e.g. changing the screen it starts on). The initial window position on start-up acts erratically when I open Sublime using the “other” icon though. I don’t see a direct pattern other than that the app starts on the same screen it closed on.

0 Likes

#15

The following lines are from my console on Windows 10 Pro 1709.

DPI mode: per-monitor v2
startup, version: 3160 windows x64 channel: dev
executable: /C/Apps/Sublime/sublime_text.exe

The only differences:

  • portable setup
  • only one screen connected
0 Likes