diff --git a/js/view.js b/js/view.js index 95c7dcd..5b535a6 100644 --- a/js/view.js +++ b/js/view.js @@ -52,21 +52,21 @@ class JsView extends View { viewInstances[this._index] = this; this._silent = !! opts.silent; - this.on('_qml_error', (data) => { + this.on('_qml_error', (data) => setImmediate(() => { if (!this._silent) { console.error(`Qml Error: (${data.type})`, data.message); } this.emit('error', new Error(`${data.type}: ${data.message}`)); - }); + })); // Expect FBO texture - this.on('_qml_fbo', (data) => { + this.on('_qml_fbo', (data) => setImmediate(() => { this._textureId = data.texture; this.emit('reset', this._textureId); - }); + })); - this.on('_qml_load', (e) => { + this.on('_qml_load', (e) => setImmediate(() => { if (e.source !== this._finalSource) { return; } @@ -82,10 +82,10 @@ class JsView extends View { this._isLoaded = true; this.emit('load'); - }); + })); - this.on('_qml_mouse', (e) => this.emit(e.type, e)); - this.on('_qml_key', (e) => this.emit(e.type, e)); + this.on('_qml_mouse', (e) => setImmediate(() => this.emit(e.type, e))); + this.on('_qml_key', (e) => setImmediate(() => this.emit(e.type, e))); if (opts.file || opts.source) { this.load(opts); diff --git a/package-lock.json b/package-lock.json index 370d39b..21d8324 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "qml-raub", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "qml-raub", - "version": "3.0.0", + "version": "3.0.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index be32b98..0a467f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Luis Blanco ", "name": "qml-raub", - "version": "3.0.0", + "version": "3.0.1", "description": "QML interoperation for Node.js", "license": "MIT", "main": "index.js",