diff --git a/docs/changelog.rst b/docs/changelog.rst index 080e92cdd..40071c6e3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -87,6 +87,9 @@ To update |kitty|, :doc:`follow the instructions `. - macOS: Fix :kbd:`ctrl+shift` with :kbd:`Esc or Function keys` not working (:iss:`4109`) +- macOS: Fix :opt:`resize_in_steps` not working correctly on high DPI screens + (:iss:`4114`) + 0.23.1 [2021-08-17] ---------------------- diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index b72d04475..b7e41e15f 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1875,10 +1875,13 @@ void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom void _glfwPlatformSetWindowSizeIncrements(_GLFWwindow* window, int widthincr, int heightincr) { - if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE) - [window->ns.object setResizeIncrements:NSMakeSize(widthincr, heightincr)]; - else + if (widthincr != GLFW_DONT_CARE && heightincr != GLFW_DONT_CARE) { + float xscale = 1, yscale = 1; + _glfwPlatformGetWindowContentScale(window, &xscale, &yscale); + [window->ns.object setResizeIncrements:NSMakeSize(widthincr / xscale, heightincr / yscale)]; + } else { [window->ns.object setResizeIncrements:NSMakeSize(1.0, 1.0)]; + } } void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)