aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js14
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