PistonDevelopers / glutin_window

A Piston window back-end using the Glutin library
MIT License
25 stars 40 forks source link

Fix dpi scaling #147

Closed 0e4ef622 closed 5 years ago

0e4ef622 commented 6 years ago

Fixes #145.

I've tested this on Linux (X and i3) and Windows 10, but I don't have a Mac to test on.

This correct_inner_size claims to work around a bug in glutin's get_inner_size, but I don't think that bug exists anymore...? So I removed it. The code seemed hacky, and I've replaced it with something that seems more in line with what the glutin docs for get_inner_size say.

bvssvni commented 6 years ago

Tested this on OSX 10.11.5, but I don't have Retina screen.

arnodb commented 6 years ago

I've been tracking a bug in the same area of the code and proposed #148 without knowing the existence of this PR. I'm afraid this PR doesn't fix my problem (incorrect resize events sent to my window on Linux).

However I'm not sure my PR is entirely good. It consists in applying "*" instead of "/" in the computation, even better: use to_physical() as written in Glutin README.

0e4ef622 commented 5 years ago

Superseded by #149.