diff --git a/src/library_glfw.js b/src/library_glfw.js index b8325f502dd99..ced031908132b 100644 --- a/src/library_glfw.js +++ b/src/library_glfw.js @@ -959,6 +959,7 @@ var LibraryGLFW = { if (!win) return; if (GLFW.active.id == win.id) { + {{{ runtimeKeepalivePush() }}} if (width == screen.width && height == screen.height) { Browser.requestFullscreen(); } else { @@ -967,6 +968,7 @@ var LibraryGLFW = { win.width = width; win.height = height; } + {{{ runtimeKeepalivePop() }}} } if (!win.windowSizeFunc) return; diff --git a/tests/glfw3.c b/tests/glfw3.c index 41da337dc7425..a2e0f8d6d456f 100644 --- a/tests/glfw3.c +++ b/tests/glfw3.c @@ -41,6 +41,13 @@ assert(glfwSet##Function(Value) == Value); /* The previously set callback */ assert(glfwSet##Function(Window, Value) == NULL); /* Default value (no callback was set) */ \ assert(glfwSet##Function(Window, Value) == Value); /* The previously set callback */ +static int exited = 0; + +__attribute__((destructor)) +void onExit() { + exited = 1; +} + int main() { GLFWwindow *window; @@ -121,9 +128,11 @@ int main() glfwSetWindowSize(window, 1, 1); glfwGetWindowSize(window, &w, &h); assert(w == 1 && h == 1); + assert(exited == 0); glfwSetWindowSize(window, 640, 480); glfwGetFramebufferSize(window, &w, &h); + assert(exited == 0); // XXX: not implemented // glfwIconifyWindow(window); diff --git a/tests/test_browser.py b/tests/test_browser.py index 70b43e31ee389..aa40b86eb6cbe 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -2864,7 +2864,7 @@ def in_html(expected): 'gl_es': (['-DCLIENT_API=GLFW_OPENGL_ES_API'],) }) def test_glfw3(self, args): - for opts in [[], ['-sLEGACY_GL_EMULATION'], ['-Os', '--closure=1']]: + for opts in [[], ['-sEXIT_RUNTIME=1'], ['-sLEGACY_GL_EMULATION'], ['-Os', '--closure=1']]: print(opts) self.btest(test_file('glfw3.c'), args=['-sUSE_GLFW=3', '-lglfw', '-lGL'] + args + opts, expected='1')