macOS: Fix incorrect text sizes calaculated when using an external display that is set to mirror the main display

Fix #1056
This commit is contained in:
Kovid Goyal 2018-10-24 06:28:58 +05:30
parent a6949df727
commit 61f3a39aa0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,9 @@ Changelog
- macOS: Fix rendering frames-per-second very low when processing
large amounts of input in small chunks (:pull:`1082`)
- macOS: Fix incorrect text sizes calaculated when using an external display
that is set to mirror the main display (:iss:`1056`)
- Linux: Fix match rules used as aliases in Fontconfig configuration not being
respected (:iss:`1085`)

View File

@ -343,6 +343,9 @@ get_window_dpi(GLFWwindow *w, double *x, double *y) {
if (monitor == NULL) { PyErr_Print(); monitor = glfwGetPrimaryMonitor(); }
float xscale = 1, yscale = 1;
if (monitor) glfwGetMonitorContentScale(monitor, &xscale, &yscale);
if (!xscale || !yscale) glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &xscale, &yscale);
if (!xscale) xscale = 1.0;
if (!yscale) yscale = 1.0;
#ifdef __APPLE__
double factor = 72.0;
#else