Skip to content

Commit 150d201

Browse files
committed
adjust GLFW window resize behavior on linux
1 parent 73744a0 commit 150d201

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/render/opengl/gl_engine_glfw.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,13 @@ void GLEngineGLFW::updateWindowSize(bool force) {
339339
void GLEngineGLFW::applyWindowSize() {
340340
glfwSetWindowSize(mainWindow, view::windowWidth, view::windowHeight);
341341

342-
// on some platform size changes are asynchonous, need to ensure it completes
343-
// we don't want to just retry until the resize has happened, because it could be impossible
344-
// TODO it seems like on X11 sometimes even this isn't enough?
345-
// glfwWaitEvents();
346-
// NSHARP: disabling this ^^^, on macOS it is causing the window to block until it gets focus,
347-
// and some googling makes me thing the underlying buffers should be resized immediately, which is
348-
// all we really care about
342+
// On some platform size changes are asynchonous, waiting for events helps to ensure the window size change actually
343+
// happens. Even this is not guaranteed to always be sufficient, but it seems to help. However, on macOS it causes the
344+
// window to block until it gets focus, which we don't want, so do it only on Windows. I'm not sure about the Windows
345+
// behavior.
346+
#if defined(__linux__)
347+
glfwWaitEvents();
348+
#endif
349349

350350
updateWindowSize(true);
351351
}

0 commit comments

Comments
 (0)