Add DPI awareness to the Steam client for Windows to resolve mouse location offset when streaming from a host PC with monitor scaling >100%
Hi folks

There's a longstanding issue with streaming via Steam using Steam Link or Remote Play from Windows-based host PCs with any application running on a monitor with scaling >100%, which causes the mouse location (co-ordinates) to be offset, making it difficult or even impossible to use the application.

I used a DPI-unaware co-ordinate mapping tool to verify the amount of the co-ordinate offset and confirmed that it is directly related to the amount of the scaling. You can calculate it yourselves by doing either of the following equivalent calculations:

* Co-ordinate x (100% / scaling percentage).
* Co-ordinate / (scaling percentage / 100%).

Examples:

With 150% scaling:
* Offset co-ords = co-ords x (100/150)
OR
* Offset co-ords = co-ords / (150/100)

With 200% scaling:
* Offset co-ords = co-ords x (100/200)
OR
* Offset co-ords = co-ords / (200/100)

After a lot of research, I discovered that Microsoft introduced a function in Windows 10 version 1607 called "SetThreadDpiAwarenessContext" to fix the issue. You can read all about the function via the following links:

* https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setthreaddpiawarenesscontext
* https://learn.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context

The function can be called by applications (such as Steam or applications running through it) or forced via the registry using a key called DpiAwareness. You can read about this here:

* https://www.maketecheasier.com/fix-blurry-dpi-unaware-apps-in-windows/

As I use Windows 11 24H2, I was able to use the PerMonitorV2 option in the registry to force Steam and non-DPI-aware applications to be DPI aware. Here is what I added to the registry for Steam executables:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\steam.exe]
"DpiAwareness"="PerMonitorV2"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\steamerrorreporter.exe]
"DpiAwareness"="PerMonitorV2"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\steamerrorreporter64.exe]
"DpiAwareness"="PerMonitorV2"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\streaming_client.exe]
"DpiAwareness"="PerMonitorV2"

After adding these for Steam and the relevant applications, plus rebooting Windows for good measure just in case, the mouse offset issue no longer occurs when streaming a game to another device.

As such, I am kindly asking the devs of the Steam client to:

* Make the Steam client natively DPI aware for compatible operating systems (Windows 10 version 1607 or later), using PerMonitorV2 where possible and PerMonitor as a fallback.
* Offer per-application and global options to force DPI-unaware applications run through Steam to be loaded as DPI aware, even if they're not natively coded as such.

This will help SO many users for minimal effort and resolve a YEARS-OLD issue for anyone loading Steam applications through Windows on any monitor with scaling >100%.

Thank you <3
Date Posted: Apr 14 @ 2:46am
Posts: 0