sumatrapdfreader / sumatrapdf

SumatraPDF reader
http://www.sumatrapdfreader.org
GNU General Public License v3.0
13.82k stars 1.74k forks source link

Dragging windows across displays with different DPI #1832

Open olimexsmart opened 3 years ago

olimexsmart commented 3 years ago

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

GitHubRulesOK commented 3 years ago

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

olimexsmart commented 3 years ago

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.

jiangzhenjerry commented 3 years ago

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.

GitHubRulesOK commented 3 years ago

@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

olimexsmart commented 2 years ago

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

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

patstew commented 2 years ago

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.

kevin-s-xu commented 2 years ago

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.

GitHubRulesOK commented 2 years ago

@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)

joedf commented 1 week ago

Pretty bad for me for quite some time. Finally was annoyed enough to look the issue up online. I am arguably partly to blame to use a 4k laptop screen with a 1080p monitor...

Looks okay, but still a little weird on the laptop

image

Worse on the monitor

image

olimexsmart commented 1 week ago

wow I opened this 4 years ago, time really flies