sumatrapdf icon indicating copy to clipboard operation
sumatrapdf copied to clipboard

Dragging windows across displays with different DPI

Open olimexsmart opened this issue 4 years ago • 8 comments

Sumatra v3.2

I have two monitors: 28" 4K (scaling 150%) and an old 20" 1680x1050 (scaling 100%).

SumatraPDF doesn't adapt to the different scaling when moving the windows from one display to another. It retains the scaling of the display where it was open. Solution is relaunching the application.

Capture Dragging from 100% to 150%, too small Capture2 Dragging from 150% to 100% too big

olimexsmart avatar Dec 17 '20 10:12 olimexsmart

Your 3.2 version is using bmp graphics, and pre-release now uses dpi aware SVG icons Going forwards there can only be changes to the newer interface, so can you please try with https://www.sumatrapdfreader.org/dailybuilds.html ( you can use the portable one, so as not to disturb your current install) https://www.sumatrapdfreader.org/prerelease

GitHubRulesOK avatar Dec 17 '20 11:12 GitHubRulesOK

Thanks for the response. I tried the portable version as you said and yes, the icons adapt to the change in scaling and resolution (being SVG as you said).

But the problem persist. Basically what we are missing here is a complete redraw of the interface to adapt to a different scaling. What is happening now is the the application checks the current scaling once, when it is launched. And maintains that scaling even when moved to a screen with different scaling. Clearly this is a problem only when using multiple screens with different scaling settings.

Even having two identical monitors, to reproduce the problem is setting one of the monitors to a different scaling setting, open SumatraPDF, and drag the window to the other screen.

olimexsmart avatar Jan 03 '21 15:01 olimexsmart

Wanted to mention that this issue happens/happened to some other applications, too. Here is the link to a discussion on the bugtracker of Notepad++, which once had this issue and then fixed it. The discussions there may shed light on how to fix for SumatraPDF.

jiangzhenjerry avatar Aug 09 '21 05:08 jiangzhenjerry

@jiangzhenjerry Thanks its way over my head TL;DR :-) however @kjk key posting and onwards seems to be https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9513#issuecomment-780384514

GitHubRulesOK avatar Aug 09 '21 10:08 GitHubRulesOK

I've just updated to v3.3.3 and the problem persists

(I'm really liking the other GUI changes BTW)

olimexsmart avatar May 19 '22 07:05 olimexsmart

It renders correctly for the screen it starts on, but when you move the window to another screen the main window doesn't change scale. The file dialogs behave correctly. Which suggests that you've enabled DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 (otherwise the file dialogs wouldn't change scale when moved) but the main window isn't responding to WM_DPICHANGED I think.

patstew avatar May 23 '22 13:05 patstew

I just noticed this issue also. I've reverted to version 3.1.2, which doesn't do this. In version 3.1.2, the toolbar icons are blurry, but the toolbar remains the correct size. More importantly, the document remains the correct size when switching between different DPI monitors.

In version 3.2+, when I switch a document from one DPI monitor to another, I also need to change the zoom level. For reference, my external monitor is set to 125% scaling, and my internal monitor (Surface Pro 8) is set to 200% scaling.

kevin-s-xu avatar Aug 27 '22 00:08 kevin-s-xu

@kevin-s-xu For what its worth you can in 3.2 (or before) use your own bitmap icons to suit your scale/taste (search bitmap bmp)

GitHubRulesOK avatar Aug 27 '22 01:08 GitHubRulesOK