Commit graph

3707 commits

Author SHA1 Message Date
Pranav Kant
2d73333984 loleaflet: 'tiledebuggingmode' is not a protocol message
Lets use this function, onMessage, for protocol messages only.

Change-Id: I418eab988ea54b814da3b05bf78b14f65709e586
2016-09-22 20:52:32 +05:30
Pranav Kant
4e6c1cf569 loleaflet: Group all other view's layers
Change-Id: Ide0d91850520e97550016b17c4505f2c75ead132
2016-09-22 20:52:32 +05:30
Pranav Kant
7ea0688760 loleaflet: Code reuse in debug mode implementation
Lets use the already existing getParameterByName function

Change-Id: Ib75ff5430e440cee609f48450a28916f9d2aff43
2016-09-22 20:52:32 +05:30
Miklos Vajna
9aeedd5268 leaflet: make sure showing the graphic view selection doesn't result in scrolling
Otherwise if you edit a different part of the document and somebody else
selects a shape, you get an unexpected, annoying jump.

Change-Id: I161a27c8a69e0873de0ebe3a020e2868cbe0afca
2016-09-22 16:56:39 +02:00
Tor Lillqvist
e7d587d694 Don't use << to write a non-nul-terminated naked char pointer 2016-09-22 14:35:16 +03:00
Miklos Vajna
2076bc54ff LOOLWSD: remove unused using decl
Change-Id: Ia3dbbb83a65485da67bede1e70a1fded2a1ade25
2016-09-22 09:12:26 +02:00
Tor Lillqvist
39f4e92b02 Log::end was missing in two places that used Log::debug()
It's too easy to forget the Log::end when using the Log::debug() etc
API. Not sure what could be done to that. Change the logging API to be
like LibreOffice's SAL_INFO?
2016-09-22 09:03:43 +03:00
Ashod Nakashian
a04f75d515 loolwsd: no need to return anything when subscribing to TileCache
Change-Id: I7b8280bf150a74db243c17cea11afc40899c4c0d
Reviewed-on: https://gerrit.libreoffice.org/29165
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:36:02 +00:00
Ashod Nakashian
d1a5745519 loolwsd: TileBeingRendered now holds the original TileDesc
Change-Id: I1c56e6b87703285ce55818aefd51ded3fefa3b74
Reviewed-on: https://gerrit.libreoffice.org/29164
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:35:17 +00:00
Ashod Nakashian
c3ed8f708c loolwsd: always request new tile rendering
This is fine since there is deduplication logic
in the queue before rendering, so it's safer
to pass client requests along and rather than not.

Change-Id: I6d50fc731a273d907e178827a09e8cf9a4b8345b
Reviewed-on: https://gerrit.libreoffice.org/29163
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:34:44 +00:00
Ashod Nakashian
b72c777f85 loolwsd: const members where possible
Change-Id: I318a76ad9e0c0ca334eb9239b61e674ce9a6a596
Reviewed-on: https://gerrit.libreoffice.org/29162
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:34:03 +00:00
Ashod Nakashian
b8317e7b34 loolwsd: lokit process logs to file if configured
Pass the log-to-file config to the kit processes
using envars.

Change-Id: Ida79c35ab02d8038685153805be780359bfbe97e
Reviewed-on: https://gerrit.libreoffice.org/29161
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:33:26 +00:00
Ashod Nakashian
1641f756b2 loolwsd: improved logging
Change-Id: I1a1559754efcb0614875dc76ae0637ed6dc1ba77
Reviewed-on: https://gerrit.libreoffice.org/29160
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-22 03:32:48 +00:00
Henry Castro
a8394110f2 loleaflet: blink cursor should en top of rendering stack 2016-09-21 15:23:58 -04:00
Tor Lillqvist
857c3c4f04 Check LOOL_NO_LOGCOLOR here, too
Note that just like for loolwsd, LOOL_NO_LOGCOLOR is effective only
when stderr is not going to a terminal. If it goes to a terminal, there
is no way to avoid use of color, see Log::initialize().
2016-09-21 18:44:02 +03:00
Tor Lillqvist
299a573996 Fix heap-use-after-free detectec by Clang's AddressSanitizer 2016-09-21 17:38:23 +03:00
Tor Lillqvist
fbc992ca42 The secure() is only in quite fresh Poco 2016-09-21 17:03:34 +03:00
Tor Lillqvist
d9c9ad0de5 Add 'override' 2016-09-21 16:54:47 +03:00
László Németh
165ab830ef add Ctrl-Shift-Alt-d shortcut to tile debugging mode 2016-09-21 13:26:59 +02:00
Pranav Kant
5ba6360a8b loleaflet: Factor out generation of .json
... so that one can use the factored-out rule, build-l10n, to
install these translation .json files in dist/ and start using
them, without having to do 'make dist' first and then extract the
package.

Change-Id: Ie2814a9f2596246b487799968f3027aa48475e7b
2016-09-21 13:57:14 +05:30
Katarina Behrens
8dfa3a49c7 Silence lintian: there are no init.d-style scripts here
Change-Id: Idae03c6ad015d5f09ce012117e6ffb88b7c7abb8
Reviewed-on: https://gerrit.libreoffice.org/29037
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:26:05 +00:00
Pranav Kant
c2f0b84dd1 loleaflet: Don't try to delete .pot files
The behavior has changed to include .pot files in git as well in
7839aecac6

So, don't try to delete these .pot files now

Change-Id: I6f5d015596ff1f2d98adca426b1458f66bc7d4b4
Reviewed-on: https://gerrit.libreoffice.org/29130
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:14:42 +00:00
Katarina Behrens
7424bfd11e Add dependency on 'adduser', postinst script needs it
Change-Id: I41c6b2d6ef9191db3a07bfaf55530659bc06a1d0
Reviewed-on: https://gerrit.libreoffice.org/29017
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2016-09-21 08:11:08 +00:00
Pranav Kant
ede173201f loleaflet: Fix admin l10n strings file location
Location was changed in 6c69b63be5
in an effort to modularize everything including these l10n
strings.

Change-Id: I4d7538a6e6d1370a45326bc163a496cf7c681259
2016-09-21 13:05:52 +05:30
Pranav Kant
ed860594a1 loleaflet: Guard against null
This helps in preventing some of many warnings in the browser
console.

Change-Id: I568b9a20e7cecfddaffd7309271fae4f6c265b46
2016-09-21 13:00:39 +05:30
Pranav Kant
a9946c59c0 loleaflet: cleanup
Change-Id: Ia61402f5e0d650d7de606b1d8c8a548453972475
2016-09-21 12:46:49 +05:30
Pranav Kant
0991924a59 loleaflet: Cleanup internal view list after socket close
Change-Id: Ic18bc0f3efcd7cf68d5291305e4f0bcff9d48fdb
2016-09-21 12:02:27 +05:30
Pranav Kant
626eab255a loleaflet: Handle new message, 'viewinfo:'
Change-Id: I82d886e3450439bbfd2e4b381cc8f9336bcdd57e
2016-09-21 12:02:27 +05:30
Pranav Kant
46107dd0c8 loolwsd: Always send the updated view info to clients
This replaces addview/remview/remallview messages in the protocol
with 'viewinfo' message which is sent whenever there is any
change in the view information.

Let the client deal with what information is redundant to it.

Change-Id: Ic470ea88a94ff281a0ae021014a9fba1b876f648
2016-09-21 12:02:27 +05:30
Ashod Nakashian
5cbc1f10a4 loolwsd: TileCacheTests cleanup
Change-Id: I88b84e9eb8d8b4e38354132c5875a26cacde9dca
Reviewed-on: https://gerrit.libreoffice.org/29128
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:19:43 +00:00
Ashod Nakashian
40f23677ee loolwsd: assume loading new view in unittests by default
...and prepare to removing view/non-view flags.

Change-Id: I464a71fa0e73abc577644170cb17309e5c8c252f
Reviewed-on: https://gerrit.libreoffice.org/29127
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:19:07 +00:00
Ashod Nakashian
ae4a9f7110 loolwsd: always request newer tile version
And accept any version newer than expected.

Since we have proper de-duplication of tiles
requesting newer versions reduces changes of
races between client and the renderer.

Change-Id: I30bb53f98ef6f1461b53c1cf527d315dc35f7f26
Reviewed-on: https://gerrit.libreoffice.org/29125
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:18:09 +00:00
Ashod Nakashian
9640fd1e78 loolwsd: handle invalidatetiles in DocumentBroker
Change-Id: I05e70f82af9b5c8bdb590a64688ffa70c6ba2034
Reviewed-on: https://gerrit.libreoffice.org/29124
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:17:27 +00:00
Ashod Nakashian
87a9f6e166 loolwsd: don't remove subscriptions on invalidation
Tile invalidation is a hint to the clients to request
fresh tiles and replace the existing ones. However
any outstanding tile request will be rendered anew.
So no need to remove those.

Nonetheless, we should issue new versions to avoid
race between old tile and invalidate. This can
happen when a tile rendered just before invalidate
reaches the client after the invalidate. The client
will think the tile is a new one when it was rendered
just before the invalidate.

Change-Id: Ieb2ffab1214dd904da8e532e7d9d20e6ad783b78
Reviewed-on: https://gerrit.libreoffice.org/29123
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:57 +00:00
Ashod Nakashian
14f11460b6 loolwsd: new multi-view canceltiles unittest
Change-Id: Ia7fdc2c64c96e3edeb82ef48d3621b70ca958b5d
Reviewed-on: https://gerrit.libreoffice.org/29122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:16:21 +00:00
Ashod Nakashian
d4a8177803 loolwsd: better timeout handling in unittests
Change-Id: Ib9a002cb25eda12335727bef56f7e2d48d682438
Reviewed-on: https://gerrit.libreoffice.org/29121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:55 +00:00
Ashod Nakashian
0326aa4304 loolwsd: cancel individual tiles
Change-Id: I18faee319fc12de2151460afbb054b8509578579
Reviewed-on: https://gerrit.libreoffice.org/29120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:15:30 +00:00
Ashod Nakashian
9e5df31cbb loolwsd: make sure to combine all contiguous tiles
Change-Id: If65e2ff53f593015ba7df23b6943a711c36550de
Reviewed-on: https://gerrit.libreoffice.org/29119
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:41 +00:00
Ashod Nakashian
6bf643183e loolwsd: cancel subscriber tiles only
Change-Id: I207f2332520f29308a2994769aa3a12ea5178477
Reviewed-on: https://gerrit.libreoffice.org/29118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:14:03 +00:00
Ashod Nakashian
8f213bc170 loolwsd: canceltiles re-designed using tilecache instead of queue
Reviewed-on: https://gerrit.libreoffice.org/28526
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 571ff06906)

Change-Id: Ie8f2c87a705aac14dd6f139c384f000df98db909
Reviewed-on: https://gerrit.libreoffice.org/29117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:13:18 +00:00
Ashod Nakashian
836219d269 loolwsd: unittests for combined rendering
Change-Id: I164942c1b14727c2f1707341d625c3b4bfc3f672
Reviewed-on: https://gerrit.libreoffice.org/29116
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 05:10:31 +00:00
Ashod Nakashian
e9f37433d7 loolwsd: combine tiles before rendering to reduce latency
Change-Id: I5af2d2a9ddf3b5a3db5bc5f0835687d7cae5b17c
Reviewed-on: https://gerrit.libreoffice.org/29115
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:59:49 +00:00
Ashod Nakashian
cdafb34b53 loolwsd: added impress tiles unittest
Change-Id: I25036f6a9ad77ebd06991866245e89c1045fbea3
Reviewed-on: https://gerrit.libreoffice.org/29114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-21 04:48:35 +00:00
Tor Lillqvist
b7aa479120 Add configure options to use a self-built cppunit
I wanted to try loolwsd built with _GLIBCXX_DEBUG defined and thus
needed cppunit built like that, too. (And Poco, but we already had
configury to point to a self-built Poco.)
2016-09-20 20:32:30 +03:00
Ashod Nakashian
3b2055a0a8 loolwsd: remove the callback descriptor after destroyView
On destroyView Core must flush the events queue, otherwise
by the next idle the descriptor will be gone and we'll
be using freed memory.

Change-Id: I6d3d8f9461bc156383a7294e9c65c535d79f2e7a
Reviewed-on: https://gerrit.libreoffice.org/29088
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-09-20 11:58:20 +00:00
László Németh
fb351f2c1a add client-side tile debugging mode
Extending the document URL with debug=1 option will switch

- visible tile boundaries
- update numbers over tiles

and invalidated tiles will be blue during waiting for an update.
2016-09-20 13:22:36 +02:00
Tor Lillqvist
90c7b553ed Don't erase the CallbackDescriptor record before turning off callbacks
Seems to fix the deadlock problem, or at least makes it very much
rarer. (I am not entirely certain that a callback might not be in
progress already (in another thread) when we turn off callbacks, and
in that case the callback might still then access freed memory?)
2016-09-20 13:32:43 +03:00
Tor Lillqvist
8207412c02 Poco::Thread::current() is not reliable for logging
It can return null for no obvious reason, leading to misleading
logging where the same thread is identified as numer zero at one place
and non-zero at another. So use the actual Linux thread id in logging.

Sure, thread ids are somewhat less convenient, as they are larger
numbers, from the same number space as process ids.
2016-09-20 13:32:43 +03:00
Pranav Kant
f84cad1e8d loleaflet: Fix some cases of leaked connecting spinner
Change-Id: If694e8f699a2a087dad1e36fc3b67960ac294560
2016-09-20 15:18:10 +05:30
Andras Timar
7465853d34 l10n: add src/control/Control.DocumentRepair.js for string extraction to pot file 2016-09-20 09:52:24 +02:00