diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-06-23 16:21:08 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-06-23 16:21:08 -0700 |
commit | 9be4b666462e7fbab8714be939a9d2a3051d409b (patch) | |
tree | 91741361005a9cfc6f8131462d9d23f4065d7a25 | |
parent | 594d83efe2cb99915c0e9fbda685860de1cbe555 (diff) |
do not trigger SDL resize events from SDL_SetVideoMode
-rw-r--r-- | src/library_sdl.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index eaa2b5bb..9f483d62 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -1325,16 +1325,20 @@ var LibrarySDL = { if (!SDL.addedResizeListener) { SDL.addedResizeListener = true; Browser.resizeListeners.push(function(w, h) { - SDL.receiveEvent({ - type: 'resize', - w: w, - h: h - }); + if (!SDL.settingVideoMode) { + SDL.receiveEvent({ + type: 'resize', + w: w, + h: h + }); + } }); } if (width !== canvas.width || height !== canvas.height) { + SDL.settingVideoMode = true; // SetVideoMode itself should not trigger resize events Browser.setCanvasSize(width, height); + SDL.settingVideoMode = false; } // Free the old surface first if there is one |