Skip to content

Commit 174313a

Browse files
WindowSizeCallback() should not try to handle DPI since already managed by GLFW (#4143)
If `FLAG_WINDOW_HIGHDPI` is set, `InitPlatform()` will aks GLFW to handle resize window content area based on the monitor content scale using : ` glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); ` So `WindowSizeCallback()` does not have to handle it a second time.
1 parent fa03246 commit 174313a

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/platforms/rcore_desktop_glfw.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,23 +1669,9 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
16691669
if (IsWindowFullscreen()) return;
16701670

16711671
// Set current screen size
1672-
#if defined(__APPLE__)
1672+
16731673
CORE.Window.screen.width = width;
16741674
CORE.Window.screen.height = height;
1675-
#else
1676-
if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
1677-
{
1678-
Vector2 windowScaleDPI = GetWindowScaleDPI();
1679-
1680-
CORE.Window.screen.width = (unsigned int)(width/windowScaleDPI.x);
1681-
CORE.Window.screen.height = (unsigned int)(height/windowScaleDPI.y);
1682-
}
1683-
else
1684-
{
1685-
CORE.Window.screen.width = width;
1686-
CORE.Window.screen.height = height;
1687-
}
1688-
#endif
16891675

16901676
// NOTE: Postprocessing texture is not scaled to new size
16911677
}

0 commit comments

Comments
 (0)