Bug Report OBS does not handle Win32 High DPI correctly

Myria

New Member
If High DPI is enabled in Windows, OBS does not handle it correctly, resulting in various ill effects, including cut-off screens and wrong-size broadcasts.

For example, I am now certain that my problem here is high DPI incompatibility:
https://obsproject.com/forum/threads/how-do-i-know-what-the-broadcast-surface-area-is.23904/
And this person's problem is probably also the same incompatibility:
https://obsproject.com/forum/threads/bottom-right-of-window-capture-is-cut-off.23365/

OBS needs to mark itself as High DPI aware, then fix up any UI issues that result. Information on High DPI is here:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd464646(v=vs.85).aspx

In order to prove that my problem was being caused by OBS being incompatible with High DPI, I hacked up the manifest in OBS.exe's resources. Other than some of the OBS buttons and words being smashed a bit close together, and telling me that I need to update all the time to the same version, my problem went away. It's clear that High DPI is what is causing the resolution issues I'm running into.

This is the old manifest:

Code:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
</assembly>

This is the new manifest I used:

Code:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0' xmlns:asmv3='urn:schemas-microsoft-com:asm.v3'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*' />
    </dependentAssembly>
  </dependency>
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

Note that the second line (<assembly>) changes as well as inserting the <asmv3> block.

Thanks,

Melissa
 

Myria

New Member
And this person's problem is probably also the same incompatibility:
https://obsproject.com/forum/threads/bottom-right-of-window-capture-is-cut-off.23365/
This person replied to the thread saying that turning off UI scaling fixed their problem, corroborating my theory as to the problem.

It looks like most of the code that will need to change in addition to this manifest change will be code that calls GetWindowRect and GetClientRect. These will need to adjust their returned coordinates according to the DPI of the monitor. Without this, even with the above manifest, OBS will think other windows in Window Capture mode are bigger than they actually are, and will try to over-read their area.
 
Top