UniExtract2 icon indicating copy to clipboard operation
UniExtract2 copied to clipboard

UniExtract doesn't handle High-DPI modes correctly

Open XJDHDR opened this issue 6 years ago • 5 comments

I am using a monitor with a DPI of ~120 (specifically, the Dell S2417DG) and Windows automatically enables high-DPI mode when I use this monitor. The problem I am having is that with high-DPI mode enabled, UniExtract doesn't work properly . To be clear, you don't need a high-DPI monitor to see a problem. My problems can be reproduced by enabling high-DPI mode. You can do this by: Windows 7 and previous: Start > Control Panel > Display > Set the Display Size to 125% or 150% Windows 8 and later: Settings app > System > Display > Set the Scaling Size to 125% or 150%

uniextract dpi off I'm including some screenshots of what is happening. This first one is UniExtract without any compatibility settings enabled. You will notice that most of the UI elements are blurry but the more serious problem is that drag-and-drop doesn't work. If I try drop a file onto UniExtract's window, I just hear the Windows Error sound play.

uniextract dpi on This next screenshot shows what happens after I enabled the compatibility setting "Override high DPI scaling behaviour. Scaling performed by: Application". You can enable this by right-clicking on UniExtract.exe > Properties > Compatibility > Tick the "Override high DPI scaling behaviour." box > In the drop-down box, select "Application" After I did this, the UI elements are no longer blurry and drag-and-drop now works again. However, the window is now around 3/4 the size it is supposed to be and some UI elements are either clipping with other elements or are very close to doing so. And this is on 125% scaling; I'm sure it would be even worse on higher scaling settings.

Microsoft has written some articles for making programs high-DPI aware: https://msdn.microsoft.com/en-us/library/windows/desktop/dd464646(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx

I personally believe that this bug can be fixed with two steps:

  1. Modify UniExtract's manifest file to tell Windows that it is a high-DPI aware program as described here: https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx This will fix Windows scaling UniExtract's window and breaking drag-and-drop as a result but it will also create the situation that I described in my second screenshot.

  2. Make UniExtract properly scale it's windows when it is running on a system with DPI scaling enabled.

If it matters, I am using Uniextract version 2.0.0 Beta 4 with Windows 10 Pro x64 version 1703 (build 15063.540)

XJDHDR avatar Sep 14 '17 09:09 XJDHDR

I would also like to have better high-DPI support.

Unfortunately, UniExtract isn't a "normal" Windows application, but it's written with AutoIt. So you can't just follow the guides you linked.

There are a few threads on the AutoIt forums that try to deal with this issue. The following seems to come closest to the "DPI Awareness Mode" that is mentioned on the Microsoft sites:

https://www.autoitscript.com/forum/topic/182423-wrong-screen-resolution-displayed-by-autoit-macros/#comment-1310175

There also seems to be an AutoIt setting that sounds interesting:

#AutoIt3Wrapper_Res_HiDpi= ;(Y/N) Compile for high DPI. Default=N

Source: https://www.autoitscript.com/forum/topic/186155-seeking-guidance-on-dpi-awareness/?do=findComment&comment=1336855

And there is also this (long) workaround:

https://www.autoitscript.com/forum/topic/166479-writing-dpi-awareness-app-workaround/

d4k0 avatar Apr 29 '18 23:04 d4k0

I'm having DPI awareness issues, too - so far, a choice between blurry or cut off. I'm actually using a tool to use Win8.1 DPI scaling on my Win10 v1709, which fixes all blur automagically, but UniExtract2 is still cut-off.

Darthagnon avatar Nov 20 '18 00:11 Darthagnon

I'm happy to see the progress as this is still an issue, here is a screenshot of how it looks on my screen. Last year, a forum post was made which provides instructions on how this can be easily fixed in AutoIt: https://www.autoitscript.com/forum/topic/199786-making-your-compiled-application-dpi-aware/

Wouterdek avatar Apr 19 '20 12:04 Wouterdek

Well, it surely took a while, but today's update (to the nightly version) finally adds support for high DPI screens. Some images don't scale properly yet, but most of the interface should look crisp now. This is a pretty big change to UniExtract, so please report any display issues you encounter here.

Bioruebe avatar Jan 29 '23 15:01 Bioruebe

Thanks, looks good so far!

d4k0 avatar Jan 29 '23 21:01 d4k0