Skip to content

Fix for DPI > 1 based on !79

Fabio Bas requested to merge ctrlaltca/krdc:dpi into master

The only way i found to get a cripsy image when screen DPI > 1 is to set the correct devicePixelRation in the image itself before painting it.

This has the side effect of making the image smaller when it gets painted. Take this in account in 2 places:

  • when the image is not scaled to window size, sizeHint() must return the session size corrected by devicePixelRatio; this causes the window to have a resolution matching the DPI-corrected size of the remote screen;
  • when the image is scaled to window size, scale the image taking in account the DPI multiplicator to get the current DPI-corrected window size.

Merge request reports