From 10478ff756958459d25d2ea86f6e8caca08bc35f Mon Sep 17 00:00:00 2001 From: Gavin Rohrer Date: Fri, 25 Apr 2025 14:32:02 -0400 Subject: [PATCH] Revert GLFW_SCALE_FRAMEBUFFER to pre GLFW 4.3 behavior --- src/platforms/rcore_desktop_glfw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 239df0657..94c780ca3 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1381,6 +1381,12 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_TRANSPARENT) > 0) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer + // HACK: Most of this was written before GLFW_SCALE_FRAMEBUFFER existed and + // was enabled by default. Disabling it gets back the old behavior. A + // complete fix will require removing a lot of CORE.Window.render + // manipulation code. + glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_FALSE); + if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { // Resize window content area based on the monitor content scale. @@ -1388,7 +1394,7 @@ int InitPlatform(void) // On platforms like macOS the resolution of the framebuffer is changed independently of the window size. glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); // Scale content area based on the monitor content scale where window is placed on #if defined(__APPLE__) - glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); + glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE); #endif } else glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_FALSE); @@ -1602,7 +1608,7 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { // NOTE: On APPLE platforms system should manage window/input scaling and also framebuffer scaling. - // Framebuffer scaling should be activated with: glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); + // Framebuffer scaling should be activated with: glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE); #if !defined(__APPLE__) glfwGetFramebufferSize(platform.handle, &fbWidth, &fbHeight);