[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-4' - 10 commits - capabilities.json configure.ac debian/changelog debian/control etc/apache2 etc/nginx loleaflet/po loleaflet/src loolwsd.spec.in tools/Config.cpp wsd/LOOLWSD.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Dec 4 21:38:53 UTC 2018
capabilities.json | 5 --
configure.ac | 2 -
debian/changelog | 6 +++
debian/control | 2 -
etc/apache2/loolwsd.conf | 4 ++
etc/nginx/loolwsd.conf | 6 +++
loleaflet/po/ui-de.po | 2 -
loleaflet/po/ui-es.po | 2 -
loleaflet/po/ui-fr.po | 2 -
loleaflet/po/ui-ja.po | 2 -
loleaflet/po/ui-pt.po | 2 -
loleaflet/src/control/Control.Scroll.js | 2 -
loleaflet/src/control/Parts.js | 2 -
loleaflet/src/layer/tile/TileLayer.js | 55 +++++++++++++++++++-----------
loleaflet/src/map/Map.js | 22 +++---------
loleaflet/src/map/handler/Map.Keyboard.js | 8 ++++
loleaflet/src/map/handler/Map.Scroll.js | 2 -
loolwsd.spec.in | 4 +-
tools/Config.cpp | 10 +++++
wsd/LOOLWSD.cpp | 28 +++------------
20 files changed, 95 insertions(+), 73 deletions(-)
New commits:
commit 49ae58ece98c9457b1b33e9f3082e71ee0ae6125
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Tue Dec 4 22:36:39 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:36:39 2018 +0100
loleaflet: updated translations
Change-Id: I987c2056b08174d7e0b2e3665602a97169c28809
diff --git a/loleaflet/po/ui-de.po b/loleaflet/po/ui-de.po
index b4bfd002e..39fbd8f67 100644
--- a/loleaflet/po/ui-de.po
+++ b/loleaflet/po/ui-de.po
@@ -834,4 +834,4 @@ msgstr "Hochladen..."
#: src/map/handler/Map.WOPI.js:250
msgid "Creating copy..."
-msgstr ""
+msgstr "Kopie erstellen..."
diff --git a/loleaflet/po/ui-es.po b/loleaflet/po/ui-es.po
index 359a3e8bd..cd7ede66b 100644
--- a/loleaflet/po/ui-es.po
+++ b/loleaflet/po/ui-es.po
@@ -834,4 +834,4 @@ msgstr "Cargando…"
#: src/map/handler/Map.WOPI.js:250
msgid "Creating copy..."
-msgstr ""
+msgstr "Creando una copia…"
diff --git a/loleaflet/po/ui-fr.po b/loleaflet/po/ui-fr.po
index ba5c45f80..bedc37e7e 100644
--- a/loleaflet/po/ui-fr.po
+++ b/loleaflet/po/ui-fr.po
@@ -834,4 +834,4 @@ msgstr "Chargement…"
#: src/map/handler/Map.WOPI.js:250
msgid "Creating copy..."
-msgstr ""
+msgstr "Création d'une copie..."
diff --git a/loleaflet/po/ui-ja.po b/loleaflet/po/ui-ja.po
index 0a5d8aa63..398c80394 100644
--- a/loleaflet/po/ui-ja.po
+++ b/loleaflet/po/ui-ja.po
@@ -834,4 +834,4 @@ msgstr "アップロード中..."
#: src/map/handler/Map.WOPI.js:250
msgid "Creating copy..."
-msgstr ""
+msgstr "コピーの作成..."
diff --git a/loleaflet/po/ui-pt.po b/loleaflet/po/ui-pt.po
index 12abf33e1..a9007b833 100644
--- a/loleaflet/po/ui-pt.po
+++ b/loleaflet/po/ui-pt.po
@@ -834,4 +834,4 @@ msgstr "A enviar..."
#: src/map/handler/Map.WOPI.js:250
msgid "Creating copy..."
-msgstr ""
+msgstr "Criar uma cópia..."
commit 16e6a04f4c8ae3e2f8323146d1e00a1b56906ada
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Thu Nov 29 15:37:19 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:19:02 2018 +0100
Bump package version to 3.4.2-1
Change-Id: I6287e625e8049a9962ef64bb01d6ba0a783f24e7
(cherry picked from commit e503dc1c82fd33f3191824f694b55fccc217e8da)
diff --git a/configure.ac b/configure.ac
index c213ed383..495767fcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
AC_PREREQ([2.63])
-AC_INIT([loolwsd], [3.4.1], [libreoffice at lists.freedesktop.org])
+AC_INIT([loolwsd], [3.4.2], [libreoffice at lists.freedesktop.org])
LT_INIT([shared, disable-static, dlopen])
AM_INIT_AUTOMAKE([1.10 subdir-objects tar-pax -Wno-portability])
diff --git a/debian/changelog b/debian/changelog
index 5438841d7..0ed964368 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+loolwsd (3.4.2-1) unstable; urgency=medium
+
+ * see the git log: http://col.la/coolcd34
+
+ -- Andras Timar <andras.timar at collabora.com> Thu, 29 Nov 2018 15:30:00 +0100
+
loolwsd (3.4.1-2) unstable; urgency=medium
* see the git log: http://col.la/coolcd34
diff --git a/debian/control b/debian/control
index 4ca2f3292..2dcc6ca2e 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Standards-Version: 3.9.7
Package: loolwsd
Section: web
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, fontconfig, libsm6, libxinerama1, libxrender1, libgl1-mesa-glx, libcups2, libcurl3-gnutls, cpio, libcap2-bin, libexpat1, libicu55, libjpeg-turbo8, libnss3, libpng12-0, libpoppler58, libxcb-render0, libxcb-shm0, libxml2, libxslt1.1, collaboraofficebasis5.3-calc (>= 5.3.10.60), collaboraofficebasis5.3-core (>= 5.3.10.60), collaboraofficebasis5.3-graphicfilter (>= 5.3.10.60), collaboraofficebasis5.3-images (>= 5.3.10.60), collaboraofficebasis5.3-impress (>= 5.3.10.60), collaboraofficebasis5.3-ooofonts (>= 5.3.10.60), collaboraofficebasis5.3-writer (>= 5.3.10.60), collaboraoffice5.3 (>= 5.3.10.60), collaboraoffice5.3-ure (>= 5.3.10.60), collaboraofficebasis5.3-en-us (>= 5.3.10.60), collaboraofficebasis5.3-en-us-calc (>= 5.3.10.60), collaboraofficebasis5.3-en-us-res (>= 5.3.10.60), collaboraofficebasis5.3-noto-fonts (>= 5.3.10.60), collaboraofficebasis5.3-draw (>= 5.3.10.60), collaboraofficebasis5.3-extension-pdf-import (>= 5.3.10.60)
, collaboraofficebasis5.3-filter-data (>= 5.3.10.60), collaboraofficebasis5.3-ooolinguistic (>= 5.3.10.60)
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, fontconfig, libsm6, libxinerama1, libxrender1, libgl1-mesa-glx, libcups2, libcurl3-gnutls, cpio, libcap2-bin, libexpat1, libicu55, libjpeg-turbo8, libnss3, libpng12-0, libpoppler58, libxcb-render0, libxcb-shm0, libxml2, libxslt1.1, collaboraofficebasis5.3-calc (>= 5.3.10.61), collaboraofficebasis5.3-core (>= 5.3.10.61), collaboraofficebasis5.3-graphicfilter (>= 5.3.10.61), collaboraofficebasis5.3-images (>= 5.3.10.61), collaboraofficebasis5.3-impress (>= 5.3.10.61), collaboraofficebasis5.3-ooofonts (>= 5.3.10.61), collaboraofficebasis5.3-writer (>= 5.3.10.61), collaboraoffice5.3 (>= 5.3.10.61), collaboraoffice5.3-ure (>= 5.3.10.61), collaboraofficebasis5.3-en-us (>= 5.3.10.61), collaboraofficebasis5.3-en-us-calc (>= 5.3.10.61), collaboraofficebasis5.3-en-us-res (>= 5.3.10.61), collaboraofficebasis5.3-noto-fonts (>= 5.3.10.61), collaboraofficebasis5.3-draw (>= 5.3.10.61), collaboraofficebasis5.3-extension-pdf-import (>= 5.3.10.61)
, collaboraofficebasis5.3-filter-data (>= 5.3.10.61), collaboraofficebasis5.3-ooolinguistic (>= 5.3.10.61)
Conflicts: collaboraofficebasis5.3-gnome-integration, collaboraofficebasis5.3-kde-integration
Description: LibreOffice Online WebSocket Daemon
LOOLWSD is a daemon that talks to web browser clients and provides LibreOffice
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index 37b8e76da..3ef3e6919 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -38,7 +38,7 @@ BuildRequires: libcap-progs linux-glibc-devel systemd-rpm-macros
BuildRequires: libcap-progs
%endif
-Requires: collaboraoffice5.3 >= 5.3.10.60 collaboraoffice5.3-ure >= 5.3.10.60 collaboraofficebasis5.3-core >= 5.3.10.60 collaboraofficebasis5.3-writer >= 5.3.10.60 collaboraofficebasis5.3-impress >= 5.3.10.60 collaboraofficebasis5.3-graphicfilter >= 5.3.10.60 collaboraofficebasis5.3-en-US >= 5.3.10.60 collaboraofficebasis5.3-calc >= 5.3.10.60 collaboraofficebasis5.3-en-US-res >= 5.3.10.60 collaboraofficebasis5.3-en-US-calc >= 5.3.10.60 collaboraofficebasis5.3-ooofonts >= 5.3.10.60 collaboraofficebasis5.3-images >= 5.3.10.60 collaboraofficebasis5.3-noto-fonts >= 5.3.10.60 collaboraofficebasis5.3-draw >= 5.3.10.60 collaboraofficebasis5.3-extension-pdf-import >= 5.3.10.60 collaboraofficebasis5.3-filter-data >= 5.3.10.60 collaboraofficebasis5.3-ooolinguistic >= 5.3.10.60
+Requires: collaboraoffice5.3 >= 5.3.10.61 collaboraoffice5.3-ure >= 5.3.10.61 collaboraofficebasis5.3-core >= 5.3.10.61 collaboraofficebasis5.3-writer >= 5.3.10.61 collaboraofficebasis5.3-impress >= 5.3.10.61 collaboraofficebasis5.3-graphicfilter >= 5.3.10.61 collaboraofficebasis5.3-en-US >= 5.3.10.61 collaboraofficebasis5.3-calc >= 5.3.10.61 collaboraofficebasis5.3-en-US-res >= 5.3.10.61 collaboraofficebasis5.3-en-US-calc >= 5.3.10.61 collaboraofficebasis5.3-ooofonts >= 5.3.10.61 collaboraofficebasis5.3-images >= 5.3.10.61 collaboraofficebasis5.3-noto-fonts >= 5.3.10.61 collaboraofficebasis5.3-draw >= 5.3.10.61 collaboraofficebasis5.3-extension-pdf-import >= 5.3.10.61 collaboraofficebasis5.3-filter-data >= 5.3.10.61 collaboraofficebasis5.3-ooolinguistic >= 5.3.10.61
Conflicts: collaboraofficebasis5.3-kde-integration collaboraofficebasis5.3-gnome-integration
Requires(post): coreutils grep sed
%if 0%{?rhel} == 6
@@ -66,7 +66,7 @@ Requires: libcap2 libpng12-0 %{fillup_prereq}
%if 0%{?suse_version} >= 1300
Requires: systemd
Requires: libopenssl1_0_0 libpcre1 libz1
-Requires: libPocoCrypto60 >= 1.9.0 libPocoFoundation60 >= 1.9.0 libPocoJSON60 >= 1.9.0 libPocoNet60 >= 1.9.0 libPocoNetSSL60 >= 1.9.0 libPocoUtil60 >= 1.9.0 libPocoXML60 >= 1.9.0
+Requires: libPocoCrypto61 >= 1.9.0 libPocoFoundation61 >= 1.9.0 libPocoJSON61 >= 1.9.0 libPocoNet61 >= 1.9.0 libPocoNetSSL61 >= 1.9.0 libPocoUtil61 >= 1.9.0 libPocoXML61 >= 1.9.0
# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
# cd /opt/collaboraoffice5.3/program ; for i in soffice.bin *.so ;do ldd $i | grep '=>' | sed -e "s/^.*=> //" -e "s/ [(].*$//"; done | sort | uniq | xargs rpm -qf --qf="%{NAME}\n" | sort | uniq | grep -v collaboraoffice
Requires: Mesa-libGL1 Mesa-libglapi0 cups-libs fontconfig krb5 libavahi-client3 libavahi-common3 libavahi-glib1 libbz2-1 libcom_err2 libdbus-1-3 libdrm2 libexpat1 libfreetype6 libkeyutils1 libpng16-16 libuuid1 libICE6 libselinux1 libSM6 libX11-6 libX11-xcb1 libXau6 libxcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libXdamage1 libXext6 libXfixes3 libXrender1 libxshmfence1 libXxf86vm1
commit b30e2ef61ab73467ca703eed806141761401d7d0
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Thu Nov 29 21:57:40 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:22 2018 +0100
add the /hosting/capabilities endpoint to the example reverse proxy configs
Change-Id: Ia4c2e4a54549af89071752c631a9ae5fed678c63
Reviewed-on: https://gerrit.libreoffice.org/64289
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit d02d1983e164b322dc3f46753433bcb23c871ce6)
diff --git a/etc/apache2/loolwsd.conf b/etc/apache2/loolwsd.conf
index 10b66b47f..7ccfe0051 100644
--- a/etc/apache2/loolwsd.conf
+++ b/etc/apache2/loolwsd.conf
@@ -20,6 +20,10 @@
ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discovery
+ # Capabilities
+ ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
+ ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities
+
# Main websocket
ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon
diff --git a/etc/nginx/loolwsd.conf b/etc/nginx/loolwsd.conf
index f55f8829b..e176760b9 100644
--- a/etc/nginx/loolwsd.conf
+++ b/etc/nginx/loolwsd.conf
@@ -10,6 +10,12 @@
proxy_set_header Host $http_host;
}
+ # Capabilities
+ location ^~ /hosting/capabilities {
+ proxy_pass http://localhost:9980;
+ proxy_set_header Host $http_host;
+ }
+
# main websocket
location ~ ^/lool/(.*)/ws$ {
proxy_pass http://localhost:9980;
commit 077e82803816fa17c6e692f08d6f957bb45286fe
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Thu Nov 29 19:15:58 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:18 2018 +0100
capabilities: Don't rely on existence of the file, compose it completely.
Change-Id: I41588afa9f26b4a2575ee8cf7d9837cc79b31b3e
Reviewed-on: https://gerrit.libreoffice.org/64302
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 0c0f71ae3842e2debfafa5d14f11569182746916)
diff --git a/capabilities.json b/capabilities.json
deleted file mode 100644
index 32ed3801f..000000000
--- a/capabilities.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "convert-to": {
- "available": false
- }
-}
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 19fd798ae..e0536ecd2 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2622,31 +2622,17 @@ private:
{
std::shared_ptr<StreamSocket> socket = _socket.lock();
- // http://server/hosting/capabilities
-#if defined __linux && defined MOBILEAPP
- std::string capabilitiesPath = Path(Application::instance().commandPath()).parent().parent().toString() + "capabilities.json";
-#else
- std::string capabilitiesPath = Path(Application::instance().commandPath()).parent().toString() + "capabilities.json";
-#endif
- if (!File(capabilitiesPath).exists())
- {
- capabilitiesPath = LOOLWSD::FileServerRoot + "/capabilities.json";
- }
- std::ifstream ifs (capabilitiesPath.c_str(), std::ifstream::in);
-
- if(!ifs.is_open())
- return "";
-
- Poco::JSON::Parser parser;
- Poco::Dynamic::Var jsonFile = parser.parse(ifs);
- Poco::JSON::Object::Ptr features = jsonFile.extract<Poco::JSON::Object::Ptr>();
- Poco::JSON::Object::Ptr convert_to = features->get("convert-to").extract<Poco::JSON::Object::Ptr>();
-
+ // Can the convert-to be used?
+ Poco::JSON::Object::Ptr convert_to = new Poco::JSON::Object;
Poco::Dynamic::Var available = allowConvertTo(socket->clientAddress(), request);
convert_to->set("available", available);
+ // Compose the content of http://server/hosting/capabilities
+ Poco::JSON::Object::Ptr capabilities = new Poco::JSON::Object;
+ capabilities->set("convert-to", convert_to);
+
std::ostringstream ostrJSON;
- features->stringify(ostrJSON);
+ capabilities->stringify(ostrJSON);
return ostrJSON.str();
}
commit 9ee24656fcaae1524afc006d5746dc9f18cf9e46
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Nov 29 13:47:55 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:14 2018 +0100
Do pass Alt + non-printing keys through with the Alt modifier intact
Such commands are used for formatting functionality. (For instance,
Alt+Left or Alt+Right to shrink or grow a column in a spreadsheet, or
Alt+Enter to insert a paragraph just before a table in a text
document.)
All the uses of Alt in the meaning "alternate character input" on an
Apple keyboard are with keys for printing characters, like Alt+2 = @
on a Swedish/Finnish keyboard.
Change-Id: I6cfde57f540ac92c63420c8d7344102645050dd0
Reviewed-on: https://gerrit.libreoffice.org/64248
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit addf7210a741e726a1ac3621e56e3067247dd852)
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 4e489b075..336c6b0b0 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -301,8 +301,10 @@ L.Map.Keyboard = L.Handler.extend({
inputEle.value = '';
}
- if (this.modifier == this.keyModifier.alt || this.modifier == this.keyModifier.shift + this.keyModifier.alt) {
+ if ((this.modifier == this.keyModifier.alt || this.modifier == this.keyModifier.shift + this.keyModifier.alt) &&
+ keyCode >= 48) {
// Presumably a Mac or iOS client accessing a "special character". Just ignore the alt modifier.
+ // But don't ignore it for Alt + non-printing keys.
this.modifier -= alt;
alt = 0;
}
commit 0094bf97b2b2f1c3ae7a5aa2bb91446f0ebb2cb9
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Tue Nov 13 14:32:37 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:10 2018 +0100
ask for username (default to 'admin' if nothing set) with 'loolconfig set-admin-password'
Change-Id: I04bf3d225e4149ed69bc55e14d1ced1dd3f8f7ea
(cherry picked from commit 96760c5e4312e924cbce550bced14384dfce940b)
Reviewed-on: https://gerrit.libreoffice.org/63330
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 40cf25a8a33c55e089b53794efc170c831c18fe2)
diff --git a/tools/Config.cpp b/tools/Config.cpp
index 6134e0e94..6a147e01b 100644
--- a/tools/Config.cpp
+++ b/tools/Config.cpp
@@ -209,6 +209,15 @@ int Config::main(const std::vector<std::string>& args)
RAND_bytes(salt, _adminConfig.pwdSaltLength);
std::stringstream stream;
+ // Ask for admin username
+ std::string adminUser;
+ std::cout << "Enter admin username [admin]: ";
+ std::getline(std::cin, adminUser);
+ if (adminUser.empty())
+ {
+ adminUser = "admin";
+ }
+
// Ask for user password
termios oldTermios;
tcgetattr(STDIN_FILENO, &oldTermios);
@@ -255,6 +264,7 @@ int Config::main(const std::vector<std::string>& args)
std::stringstream pwdConfigValue("pbkdf2.sha512.", std::ios_base::in | std::ios_base::out | std::ios_base::ate);
pwdConfigValue << std::to_string(_adminConfig.pwdIterations) << ".";
pwdConfigValue << saltHash << "." << passwordHash;
+ _loolConfig.setString("admin_console.username", adminUser);
_loolConfig.setString("admin_console.secure_password[@desc]",
"Salt and password hash combination generated using PBKDF2 with SHA512 digest.");
_loolConfig.setString("admin_console.secure_password", pwdConfigValue.str());
commit f166d5e4a5adc70ea08cc4a5f26742783660caa5
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Nov 23 12:47:33 2018 +0000
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:05 2018 +0100
Show cursor, even with a selected graphic / shape.
Change-Id: I18f63a5cd4bb2673827b1bc8d64e53df1a09b4f9
Reviewed-on: https://gerrit.libreoffice.org/63960
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 6b11b66625e0a4a27539b19ccadf1d0295689b4e)
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index ebae1bbd7..106a16503 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1490,7 +1490,7 @@ L.TileLayer = L.GridLayer.extend({
&& this._isCursorVisible // only when LOK has told us it is ok
&& this._isFocused // not when document is not focused
&& !this._isZooming // not when zooming
- && !this.isGraphicVisible() // not when sizing / positioning graphics
+// && !this.isGraphicVisible() // not when sizing / positioning graphics
&& !this._isEmptyRectangle(this._visibleCursor)) {
this._updateCursorPos();
}
commit 39bee53c6c17302d19718138b728f5a46a30bf31
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Oct 24 18:37:17 2018 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:15:00 2018 +0100
tdf#120438: Don't handle a lone "alt" modifier in any special way
It is likely a Mac browser client simply accessing a "special
character" on their keyboard. (Or an iOS browser client using a
physical keyboard.) Like alt+8 to get '[' on a Swedish/Finnish Apple
keyboard, or alt+shift+2 to get '€' on a US English Apple keyboard.
Change-Id: I94b49d64db87324ff2a5cd5f50226d3c537b68e6
Reviewed-on: https://gerrit.libreoffice.org/62315
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
(cherry picked from commit 1e97cfc2d2a8ee3e296ddfb7a331466bede4a575)
Reviewed-on: https://gerrit.libreoffice.org/64166
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
(cherry picked from commit 80e91e5e3935b46bb8a9c084b04a863ff90436e4)
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index f5d3282da..4e489b075 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -301,6 +301,12 @@ L.Map.Keyboard = L.Handler.extend({
inputEle.value = '';
}
+ if (this.modifier == this.keyModifier.alt || this.modifier == this.keyModifier.shift + this.keyModifier.alt) {
+ // Presumably a Mac or iOS client accessing a "special character". Just ignore the alt modifier.
+ this.modifier -= alt;
+ alt = 0;
+ }
+
var unoKeyCode = this._toUNOKeyCode(keyCode);
if (this.modifier) {
commit 93237e72a333608aad93e401191bd7abdf91fedf
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Sat Oct 6 22:37:50 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:14:56 2018 +0100
Simplify cursor visibility.
Removes race conditions between kit messages and browser.
Avoid storing old state wherever possible.
Change-Id: I56aa57df22a4190881c8d197df8445ca542d4fc1
cursor simplify.
Don't show cursor when graphics are selected either.
Change-Id: I0a604d73bd1818317a2b04d8bdd392d1d6472627
Hide other view cursors on zoom.
Change-Id: I9e953f841b5c526b499f9170aef9b2682011947e
(cherry picked from commit 98fe14c28e94ef499f27d1b1b585a199961fcf7f)
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 21c8525fd..c37636bc6 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -21,7 +21,7 @@ L.Map.include({
else {
return;
}
- if (docLayer._isCursorOverlayVisible) {
+ if (docLayer.isCursorVisible()) {
// a click outside the slide to clear any selection
this._socket.sendMessage('resetselection');
}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index b3f45581d..ebae1bbd7 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -75,10 +75,10 @@ L.TileLayer = L.GridLayer.extend({
this._documentInfo = '';
// Position and size of the visible cursor.
this._visibleCursor = new L.LatLngBounds(new L.LatLng(0, 0), new L.LatLng(0, 0));
- // Cursor overlay is visible or hidden (for blinking).
- this._isCursorOverlayVisible = false;
- // Cursor overlay visibility flag to store last state during zooming
- this._oldCursorOverlayVisibility = false;
+ // Do we have focus - ie. should we render a cursor
+ this._isFocused = true;
+ // Are we zooming currently ? - if so, no cursor.
+ this._isZooming = false;
// Cursor is visible or hidden (e.g. for graphic selection).
this._isCursorVisible = true;
// Original rectangle graphic selection in twips
@@ -531,7 +531,6 @@ L.TileLayer = L.GridLayer.extend({
_onCursorVisibleMsg: function(textMsg) {
var command = textMsg.match('cursorvisible: true');
this._isCursorVisible = command ? true : false;
- this._isCursorOverlayVisible = true;
this._onUpdateCursor();
},
@@ -745,8 +744,6 @@ L.TileLayer = L.GridLayer.extend({
this._visibleCursor = new L.LatLngBounds(
this._twipsToLatLng(topLeftTwips, this._map.getZoom()),
this._twipsToLatLng(bottomRightTwips, this._map.getZoom()));
- this._visibleCursorOnLostFocus = this._visibleCursor;
- this._isCursorOverlayVisible = true;
if ((docLayer._followEditor || docLayer._followUser) && this._map.lastActionByUser) {
this._map.fire('setFollowOff');
}
@@ -1354,8 +1351,7 @@ L.TileLayer = L.GridLayer.extend({
},
_clearSelections: function () {
- // hide the cursor
- this._isCursorOverlayVisible = false;
+ // hide the cursor if not editable
this._onUpdateCursor();
// hide the text selection
this._selections.clearLayers();
@@ -1432,15 +1428,16 @@ L.TileLayer = L.GridLayer.extend({
},
_onZoomStart: function () {
- this._oldCursorOverlayVisibility = this._isCursorOverlayVisible;
- this._isCursorOverlayVisible = false;
+ this._isZooming = true;
this._onUpdateCursor();
+ this.updateAllViewCursors();
},
_onZoomEnd: function () {
- this._isCursorOverlayVisible = this._oldCursorOverlayVisibility;
+ this._isZooming = false;
this._onUpdateCursor();
+ this.updateAllViewCursors();
},
_updateCursorPos: function () {
@@ -1481,7 +1478,7 @@ L.TileLayer = L.GridLayer.extend({
this.eachView(this._viewCursors, function (item) {
var viewCursorMarker = item.marker;
if (viewCursorMarker) {
- viewCursorMarker.setOpacity(this._map.hasLayer(this._cursorMarker) && this._cursorMarker.getLatLng().equals(viewCursorMarker.getLatLng()) ? 0 : 1);
+ viewCursorMarker.setOpacity(this.isCursorVisible() && this._cursorMarker.getLatLng().equals(viewCursorMarker.getLatLng()) ? 0 : 1);
}
}, this, true);
},
@@ -1490,14 +1487,15 @@ L.TileLayer = L.GridLayer.extend({
// the state of the document (if the falgs are set)
_updateCursorAndOverlay: function (update) {
if (this._map._permission === 'edit'
- && this._isCursorVisible
- && this._isCursorOverlayVisible
+ && this._isCursorVisible // only when LOK has told us it is ok
+ && this._isFocused // not when document is not focused
+ && !this._isZooming // not when zooming
+ && !this.isGraphicVisible() // not when sizing / positioning graphics
&& !this._isEmptyRectangle(this._visibleCursor)) {
this._updateCursorPos();
}
else if (this._cursorMarker) {
this._map.removeLayer(this._cursorMarker);
- this._isCursorOverlayVisible = false;
}
},
@@ -1515,8 +1513,11 @@ L.TileLayer = L.GridLayer.extend({
var viewCursorVisible = this._viewCursors[viewId].visible;
var viewPart = this._viewCursors[viewId].part;
- if (!this._map.isViewReadOnly(viewId) && viewCursorVisible && !this._isEmptyRectangle(this._viewCursors[viewId].bounds) &&
- (this._docType === 'text' || this._selectedPart === viewPart)) {
+ if (!this._map.isViewReadOnly(viewId) &&
+ viewCursorVisible &&
+ !this._isZooming &&
+ !this._isEmptyRectangle(this._viewCursors[viewId].bounds) &&
+ (this._docType === 'text' || this._selectedPart === viewPart)) {
if (!viewCursorMarker) {
var viewCursorOptions = {
color: L.LOUtil.rgbToHex(this._map.getViewColor(viewId)),
@@ -1532,7 +1533,7 @@ L.TileLayer = L.GridLayer.extend({
else {
viewCursorMarker.setLatLng(viewCursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
}
- viewCursorMarker.setOpacity(this._map.hasLayer(this._cursorMarker) && this._cursorMarker.getLatLng().equals(viewCursorMarker.getLatLng()) ? 0 : 1);
+ viewCursorMarker.setOpacity(this.isCursorVisible() && this._cursorMarker.getLatLng().equals(viewCursorMarker.getLatLng()) ? 0 : 1);
this._viewLayerGroup.addLayer(viewCursorMarker);
}
else if (viewCursorMarker) {
@@ -1540,6 +1541,20 @@ L.TileLayer = L.GridLayer.extend({
}
},
+ updateAllViewCursors : function() {
+ for (var key in this._viewCursors) {
+ this._onUpdateViewCursor(key);
+ }
+ },
+
+ isCursorVisible: function() {
+ return this._map.hasLayer(this._cursorMarker);
+ },
+
+ isGraphicVisible: function() {
+ return this._graphicMarker && this._map.hasLayer(this._graphicMarker);
+ },
+
goToViewCursor: function(viewId) {
if (viewId === this._viewId) {
this._onUpdateCursor();
@@ -1706,7 +1721,6 @@ L.TileLayer = L.GridLayer.extend({
this._graphicMarker = L.rectangle(this._graphicSelection, {
pointerEvents: 'none',
fill: false});
- this._visibleCursor = this._visibleCursorOnLostFocus = this._graphicMarker._bounds;
if (!this._graphicMarker) {
this._map.fire('error', {msg: 'Graphic marker initialization', cmd: 'marker', kind: 'failed', id: 1});
return;
@@ -1721,6 +1735,7 @@ L.TileLayer = L.GridLayer.extend({
this._map.removeLayer(this._graphicMarker);
this._graphicMarker.isDragged = false;
}
+ this._updateCursorAndOverlay();
},
_onUpdateCellCursor: function (horizontalDirection, verticalDirection, onPgUpDn) {
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 7a078ebd2..1dffaa458 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -988,15 +988,9 @@ L.Map = L.Evented.extend({
console.debug('_onLostFocus: ');
var doclayer = this._docLayer;
- if (!doclayer) { return; }
-
- // save state of cursor (blinking marker) and the cursor overlay
- doclayer._isCursorVisibleOnLostFocus = doclayer._isCursorVisible;
- doclayer._isCursorOverlayVisibleOnLostFocus = doclayer._isCursorOverlayVisible;
-
- // if the blinking cursor is visible, disable the overlay when we go out of focus
- if (doclayer._isCursorVisible && doclayer._isCursorOverlayVisible) {
- doclayer._isCursorOverlayVisible = false;
+ if (doclayer)
+ {
+ doclayer._isFocused = false;
doclayer._updateCursorAndOverlay();
}
@@ -1008,16 +1002,14 @@ L.Map = L.Evented.extend({
if (!this._loaded) { return; }
var doclayer = this._docLayer;
- if (doclayer &&
- typeof doclayer._isCursorOverlayVisibleOnLostFocus !== 'undefined' &&
- typeof doclayer._isCursorVisibleOnLostFocus !== 'undefined') {
+ if (doclayer)
+ {
+ doclayer._isFocused = true;
// we restore the old cursor position by a small delay, so that if the user clicks
// inside the document we skip to restore it, so that the user does not see the cursor
// jumping from the old position to the new one
setTimeout(function () {
- // restore the state that was before focus was lost
- doclayer._isCursorOverlayVisible = doclayer._isCursorOverlayVisibleOnLostFocus;
- doclayer._isCursorVisible = doclayer._isCursorVisibleOnLostFocus;
+ console.debug('apply focus change in timeout');
doclayer._updateCursorAndOverlay();
}, 300);
}
commit 586db53953d3297fe17e23f2c542db130cdc0680
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Nov 12 22:09:07 2018 +0000
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Dec 4 22:14:50 2018 +0100
Avoid scroll-wheel jittering, and shrink the scroll increment.
Hypothetically the underlying cause is that malihu's
scrollTo:function(val,options){ calculates data based on current state,
dispatches asynchronous changes to that state, and can thus while
that change is in-flight can mis-calculate subsequent changes - causing
significant jitter.
Change-Id: I3c8becead04582b05e30d7dfab233e898509cd75
(cherry picked from commit c81dca923e5a8bef50b9509a1f5d4994a1ac8acd)
diff --git a/loleaflet/src/control/Control.Scroll.js b/loleaflet/src/control/Control.Scroll.js
index 4973e109d..a3fe3725c 100644
--- a/loleaflet/src/control/Control.Scroll.js
+++ b/loleaflet/src/control/Control.Scroll.js
@@ -168,7 +168,7 @@ L.Control.Scroll = L.Control.extend({
if (e.x < 0) {
x = '-=' + Math.abs(e.x);
}
- $('.scroll-container').mCustomScrollbar('scrollTo', [y, x]);
+ $('.scroll-container').mCustomScrollbar('scrollTo', [y, x], { timeout: 1 });
},
_onScrollVelocity: function (e) {
diff --git a/loleaflet/src/map/handler/Map.Scroll.js b/loleaflet/src/map/handler/Map.Scroll.js
index 9c584ecc1..2203b6596 100644
--- a/loleaflet/src/map/handler/Map.Scroll.js
+++ b/loleaflet/src/map/handler/Map.Scroll.js
@@ -53,7 +53,7 @@ L.Map.Scroll = L.Handler.extend({
_performScroll: function () {
var map = this._map,
delta = -this._delta,
- scrollAmount = Math.round(map.getSize().y / 4);
+ scrollAmount = Math.round(map.getSize().y / 20);
this._delta = 0;
this._startTime = null;
More information about the Libreoffice-commits
mailing list