GLFW Window Freezing When Resizing on High-DPI Displays

Hello

I’m encountering an issue where a GLFW window becomes unresponsive or lags significantly when resized on a high-DPI display (e.g., 4K monitor with scaling enabled). :innocent:The problem is more noticeable when using GLFW with OpenGL and VSync enabled. The window either freezes temporarily or exhibits a significant drop in responsiveness, making real-time resizing impractical.

I’ve tested different GLFW hints like GLFW_SCALE_TO_MONITOR and experimented with various buffer swap interval settings, but the issue persists. :upside_down_face: Profiling suggests that the event loop stalls during the resizing operation, possibly due to inefficient handling of framebuffer size changes.

This issue does not occur on standard DPI displays or when scaling is disabled, so it seems related to how GLFW interacts with high-DPI scaling mechanisms.

Has anyone else faced similar problems? Are there recommended best practices for handling window resizing smoothly on high-DPI displays? :thinking: Checked https://www.glfw.org/docs/latest/window_guide.html_ mlops guide related to this and found it quite informative.

Would implementing a separate thread for event handling or tweaking framebuffer configurations improve performance? Any insights would be greatly appreciated! :slightly_smiling_face:

Thank you !! :slightly_smiling_face:

Hi,

I’m encountering an issue where a GLFW window becomes unresponsive or lags significantly when resized on a high-DPI display (e.g., 4K monitor with scaling enabled).

Does this occur with just a GLFW window and no content being rendered?

Profiling suggests that the event loop stalls during the resizing operation

The Windows OS does not return from the event loop during resizing, so if this is on Windows then this is an OS feature. Threaded rendering is one way to partially work around this.

possibly due to inefficient handling of framebuffer size changes

GLFW itself does not handle framebuffer size changes, for OpenGL this is done by the OS & graphics driver, and for Vulkan this is user code.