Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/library_glfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -967,6 +968,7 @@ var LibraryGLFW = {
win.width = width;
win.height = height;
}
{{{ runtimeKeepalivePop() }}}
}

if (!win.windowSizeFunc) return;
Expand Down
9 changes: 9 additions & 0 deletions tests/glfw3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down