Skip to content

Commit a92c42c

Browse files
authored
Calling GLFW.setWindowSize with the screen size leads to browser error (#20699)
Fixes: #20600
1 parent 40cbc21 commit a92c42c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.49 (in development)
2222
-----------------------
23+
- The `glfwSetWindowSize` function no longer switches to fullscreen when the
24+
width/height provided as parameters match the screen size. This behavior
25+
now matches the behavior of SDL and glut. In order to switch to fullscreen,
26+
the client code should invoke `Module.requestFullscreen(...)` from a user
27+
triggered event otherwise the browser raises an error. (#20600)
2328

2429
3.1.48 - 11/05/23
2530
-----------------

src/library_glfw.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -981,14 +981,9 @@ var LibraryGLFW = {
981981
if (!win) return;
982982

983983
if (GLFW.active.id == win.id) {
984-
if (width == screen.width && height == screen.height) {
985-
Browser.requestFullscreen();
986-
} else {
987-
Browser.exitFullscreen();
988-
Browser.setCanvasSize(width, height);
989-
win.width = width;
990-
win.height = height;
991-
}
984+
Browser.setCanvasSize(width, height);
985+
win.width = width;
986+
win.height = height;
992987
}
993988

994989
if (win.windowSizeFunc) {

0 commit comments

Comments
 (0)