[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu May 30 15:03:19 UTC 2019


 loleaflet/src/map/Map.js              |    6 ++++++
 loleaflet/src/map/handler/Map.WOPI.js |    5 +++++
 2 files changed, 11 insertions(+)

New commits:
commit c522dbf6da67e25fdb00e71f71a8a6551f11b38f
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu May 30 16:02:43 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Thu May 30 16:02:43 2019 +0100

    Add interoperable Grab_Focus PostMessage.
    
    Change-Id: I42cd24bfd502f46bb3f41cd6cf2f551263d57687

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 272f7fe1c..c1eba3297 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -982,6 +982,12 @@ L.Map = L.Evented.extend({
 			function () { this.invalidateSize({debounceMoveend: true}); }, this, false, this._container);
 	},
 
+	makeActive: function() {
+		console.log('Force active');
+		this.lastActiveTime = Date.now();
+		return this._activate();
+	},
+
 	_activate: function () {
 		if (this._serverRecycling || this._documentIdle) {
 			return false;
diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index be108a108..d99d17520 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -157,6 +157,11 @@ L.Map.WOPI = L.Handler.extend({
 			return;
 		}
 
+		if (msg.MessageId === 'Grab_Focus') {
+			this._map.makeActive();
+			return;
+		}
+
 		// allow closing documents before they are completely loaded
 		if (msg.MessageId === 'Close_Session') {
 			this._map._socket.sendMessage('closedocument');


More information about the Libreoffice-commits mailing list