loleaflet/src/core/Socket.js | 30 ++++++++++++++++-------------- loleaflet/src/layer/tile/TileLayer.js | 11 ++++++----- 2 files changed, 22 insertions(+), 19 deletions(-)
New commits: commit c45dfe194bbcb10514761c3564f42a8ff7f3fc17 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Mon Apr 22 12:00:19 2019 -0400 Commit: Ashod Nakashian <ashnak...@gmail.com> CommitDate: Tue Apr 23 03:01:46 2019 +0200 leaflet: process the most common message first The 'tile:' message is the most common and most latency sensitive message, so give it priority. Change-Id: Id5790369cd493423a47acab8a3d5107ce91b0d39 Reviewed-on: https://gerrit.libreoffice.org/71071 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index b02b00943..464a1f1df 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -810,20 +810,22 @@ L.Socket = L.Class.extend({ this._map.fire('docloaded', {status: true}); } - // these can arrive very early during the startup - if (textMsg.startsWith('statusindicatorstart:')) { - this._map.fire('statusindicator', {statusType : 'start'}); - return; - } - else if (textMsg.startsWith('statusindicatorsetvalue:')) { - var value = textMsg.match(/\d+/g)[0]; - this._map.fire('statusindicator', {statusType : 'setvalue', value : value}); - return; - } - else if (textMsg.startsWith('statusindicatorfinish:')) { - this._map.fire('statusindicator', {statusType : 'finish'}); - this._map._fireInitComplete('statusindicatorfinish'); - return; + // These can arrive very early during the startup, and never again. + if (textMsg.startsWith('statusindicator')) { + if (textMsg.startsWith('statusindicatorstart:')) { + this._map.fire('statusindicator', {statusType : 'start'}); + return; + } + else if (textMsg.startsWith('statusindicatorsetvalue:')) { + var value = textMsg.match(/\d+/g)[0]; + this._map.fire('statusindicator', {statusType : 'setvalue', value : value}); + return; + } + else if (textMsg.startsWith('statusindicatorfinish:')) { + this._map.fire('statusindicator', {statusType : 'finish'}); + this._map._fireInitComplete('statusindicatorfinish'); + return; + } } if (this._map._docLayer) { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 42c880e57..43256a15e 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -359,7 +359,11 @@ L.TileLayer = L.GridLayer.extend({ }, _onMessage: function (textMsg, img) { - if (textMsg.startsWith('commandvalues:')) { + // 'tile:' is the most common message type; keep this the first. + if (textMsg.startsWith('tile:')) { + this._onTileMsg(textMsg, img); + } + else if (textMsg.startsWith('commandvalues:')) { this._onCommandValuesMsg(textMsg); } else if (textMsg.startsWith('cursorvisible:')) { @@ -447,9 +451,6 @@ L.TileLayer = L.GridLayer.extend({ else if (textMsg.startsWith('textselectionstart:')) { this._onTextSelectionStartMsg(textMsg); } - else if (textMsg.startsWith('tile:')) { - this._onTileMsg(textMsg, img); - } else if (textMsg.startsWith('windowpaint:')) { this._onDialogPaintMsg(textMsg, img); } @@ -812,7 +813,7 @@ L.TileLayer = L.GridLayer.extend({ //first time document open, set last cursor position if (this.lastCursorPos.lat === 0 && this.lastCursorPos.lng === 0) this.lastCursorPos = cursorPos; - + var updateCursor = false; if ((this.lastCursorPos.lat !== cursorPos.lat) || (this.lastCursorPos.lng !== cursorPos.lng)) { updateCursor = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits