Fix wrong DPI when moving window across screens

Authored by alvinhochun on Apr 1 2019, 3:29 PM.



This fixes a bug causing the wrong DPI being used when moving the window from a screen to another screen to the left. Using the top-left position of the window to determine screen changes doesn't work well since the device pixel ratio of a window does not change until the window is roughly halfway across.

Test Plan
  1. Use two screens with different DPI scaling.
  2. With the window on the left screen, open an image and note the image size at 100% zoom.
  3. Move window from the left screen to the right screen then back to the left screen.
  4. Verify that the image size is the same as before.

Diff Detail

R37 Krita
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
alvinhochun requested review of this revision.Apr 1 2019, 3:29 PM
alvinhochun created this revision.
dkazakov accepted this revision.Apr 1 2019, 9:51 PM
dkazakov added a subscriber: dkazakov.

Hi, @alvinhochun!

The patch seems to work! I don't know we didn't use it before. perhaps it was not present in older versions of Qt :)

This revision is now accepted and ready to land.Apr 1 2019, 9:51 PM
This revision was automatically updated to reflect the committed changes.