Commit graph

146 commits

Author SHA1 Message Date
Tamás Zolnai
dce6c18fb4 Calculate tiles-on-fly limit a bit more precisely
Change-Id: Id012a83d6ccd226d1b66e3cd48a9caeafd849fc5
2018-08-30 18:42:55 +02:00
Tamás Zolnai
1b01af3605 First forward invalidation to client and request tiles after 2018-08-26 06:49:34 +02:00
Tamás Zolnai
185b933353 Go back using list for tilesOnFly
It can handle duplicates which we need to have.

Change-Id: Ia4cd813dd173bc538dd27953c4886d460b5b1c49
2018-08-23 13:44:39 +02:00
Tamás Zolnai
3bd7c6b508 Fix previous commit
Change-Id: I7d3bce0132d124e52f7885c8cb3c26acc6f7b41d
2018-08-23 13:04:48 +02:00
Tamás Zolnai
759d1fe722 Drop too old tileID's from tiles-on-fly list
So we can avoid that tile sending stop working because server is
waiting for tileprocessed messages which will not arrive.

Change-Id: I545346c50d49340999608aadac32b5190ede43c5
2018-08-23 12:47:52 +02:00
Tamás Zolnai
3ca4421eb7 Updated deduplicated tiles wireID
Change-Id: Ia901d8831792de1bee6b21017be02fa1e744e2ee
2018-08-22 23:20:27 +02:00
Tamás Zolnai
d0fb39cd76 Handle negativ position value of clientvisiblearea
Change-Id: I1bf1217e038d034167e1a5412d81a311ebbd83ed
2018-08-22 16:53:01 +02:00
Tamás Zolnai
25e1a01a3c Handle tiles hanging out the visible area
A problem comes up when only a part of the tile is visible
on the client side and invalidation affects the invisible
part of this tile. To get back the old / right behavior we
need to request this kind of tiles too.
2018-08-22 13:49:23 +02:00
Tamás Zolnai
7d98b5f015 Revert "Get back "Cancel tiles also in wsd's senderqueue""
This reverts commit f1a385be98.

It's not easy, it can interfere the tile tracking.

Change-Id: I1e4ec9b4d66e5e912873f673fd5cb71ba55a9332
Reviewed-on: https://gerrit.libreoffice.org/59326
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-08-20 15:13:59 +02:00
Tamás Zolnai
f1a385be98 Get back "Cancel tiles also in wsd's senderqueue"
This reverts commit ec8b7bc012.

Change-Id: I0a4f3f529c86522261085d4feec45e4b56a7e0e6
2018-08-17 23:47:10 +02:00
Tor Lillqvist
4dd62d4dd2 Revert "Add a cache of "thumbnails" (PNG images) generated using the convert-to API"
No need to keep such a cache here. The consumer of previews
(thumbnails) in question does it itself (Nextcloud).

This reverts commit 405b66c8db

Change-Id: Iad16212ccbc875fe4f6d041e2fceef7eaea1d1bb
2018-08-15 15:01:03 +03:00
Tamás Zolnai
6d3a0d0327 Update row by row, instead of column by column
Change-Id: I504cab9509d25eebf3f68c63dd7e18a54f80d865
2018-08-10 17:49:48 +02:00
Tamás Zolnai
1a885b9c40 Store wireId only for tiles inside the visible area
Change-Id: If60015c86bbdd1158c203a7a9c47b3dc877ac6c5
2018-08-07 16:22:48 +02:00
Tamás Zolnai
e35ce41eaa Need to reset wireId map anytime when part number changes
Change-Id: I8309a0a0788587f6daebe9698723df6bc0410039
2018-08-07 16:22:48 +02:00
Tamás Zolnai
ec8b7bc012 Revert "Cancel tiles also in wsd's senderqueue"
This reverts commit 0bb96131c4.

Change-Id: Iffea072aabc88e5150e6ec069917b7965850683a
2018-08-03 12:21:29 +02:00
Tamás Zolnai
8d95ca7165 Make client tilesBeingRendered tracking more robust
Store the tile cache names and drop outdated tiles
times to times, so we can avoid tile rendering / sending to
stuck.

Change-Id: Ibff001307c7c660cbc57ab20c29c430e0090444d
2018-07-31 15:44:15 +02:00
Tamás Zolnai
0bb96131c4 Cancel tiles also in wsd's senderqueue
Change-Id: I683b3cacee2f87d0dc0f28ad9ac3e122bcd043f1
2018-07-31 13:18:44 +02:00
Tamás Zolnai
c2a5f6acb0 Store number of tiles sent to kit for rendering
and use that info also to avoid sending to much tiles on the network.

Change-Id: Iab2d7af64693047a3c1cfe9f73de80a7100bbc13
2018-07-24 20:52:53 +02:00
Tamás Zolnai
8d92b0809d Store wiredIDs on the server side
So we can use this information in tile requests.

Change-Id: I87ba420ec0fd699353d48a228268e546ace21921
2018-07-19 14:13:03 +02:00
Tamás Zolnai
2fda5f7d92 Use an upper limit for number of tiles we push to the network
I used number 25 as this limit. It's an approximate value. It's enough
to handle the first 5-10 character input without waiting for tileprocessed
messages. After the first 5-10 characters the tileprocessed messages are
arriving continuously (same frequency as the typing speed), so for the later
character inputs we always have some tileprocessed messages arrived so
we can push new tiles to the network again.
This 25 upper limit also seems enough to send all tiles when a whole page is
requested (e.g. zoom os scroll).

We store the requested tiles in a list, used as a queue. I don't use std::queue
because sometimes we need to do deduplication (replace older versions of the
same tile with a newer version).

Change-Id: I22ff3e35c8ded6001c7fc160abdc1f1b12ce3bae
2018-07-19 14:12:41 +02:00
Tamás Zolnai
6c4e4440e8 Handle part number a bit more robust in case of Writer
Change-Id: I7390f1c5f4289be67deacf3540068c040b230584
2018-07-19 14:12:15 +02:00
Tamás Zolnai
7428c46efe In Impress setpart message's syntax is a bit different.
Two alternative sytnax:
"setpart part=1"
"setpart 1"

Change-Id: I42683ca46d642d56cfc3dcc52a10d69a3f00462b
2018-07-19 14:12:02 +02:00
Tamás Zolnai
29df46219c Need to extract the initial part id from status message
Change-Id: Ia0651d93fedb71d3ca1e24d0356ac179e95e907e
2018-07-19 14:11:36 +02:00
Tamás Zolnai
85f96bc281 Store sent tiles's id instead of using a simple counter
Change-Id: I8cbf84923a53fb6b294bd4039eb7382326f8c445
2018-07-19 14:11:18 +02:00
Tamás Zolnai
a9c5ea9022 Add a timeout for tileprocessed message handling
For debug purposes.

Change-Id: Icc9dfc05b18f9da96b29b7cadeb57f7218832295
2018-07-19 14:10:22 +02:00
Tamás Zolnai
15afe2c0fb Wait tileprocessed message from client to send new bunch of tiles
We always  one bunch of tiles (e.g. all tiles invalidated) and we
are waiting until client send tileprocessed message back for all
tiles before sending the new tiles.
By canceltiles message we drop every previously requested tiles and
make wsd ready to send new tiles, which will be requested by the client
in theory.

Change-Id: I9901420ada549e962ffaf5e6bd58e52b86bd129d
2018-07-19 14:10:08 +02:00
Tamás Zolnai
57cdd68fcf Request new tiles in wsd by invalidateTiles message
And don't wait for the client to send back a tilecombine
request.

Change-Id: I9ea5de0f6b12dfaaf61992d34735d5b78ea382ed
2018-07-19 14:09:49 +02:00
Tamás Zolnai
161695eb66 Store client's visible are information in wsd
Change-Id: Iec3c146181b7db2e76247d5775076e6ac90eed2c
2018-07-19 14:09:33 +02:00
Pranav Kant
6f8b15dfa8 wsd: missing include
Change-Id: I561db86b4b46f1cff0d9f0c744c556d9ec74291f
2018-07-16 10:34:24 +05:30
Tor Lillqvist
405b66c8db Add a cache of "thumbnails" (PNG images) generated using the convert-to API
When asked to "convert" a document to a PNG image, i.e. what one can
call a thumbnail, check if we have a cached PNG for the same docuemnt
already, and in that case return it.

When we have done such a convert-to operation to PNG, save the result
in the cache for later re-use.

This change adds no thumbnail cache cleanup mechanism. That will have
to be implemented separately using a cron job or whatever.

There are further improvement possibilities: For instance, if the
document is of a type that contains an embedded thumbnail (like ODF),
just extract and return that. For ODF that embedded thumbnail even
already is in PNG format.

Change-Id: I882efe97acc1d81041dc7a4ccb222995940e4836
Reviewed-on: https://gerrit.libreoffice.org/57345
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2018-07-12 18:27:23 +02:00
Tor Lillqvist
1c09d4a607 Improve logging a bit
Log all error: cases in ClientSession::handleKitToClientMessage(), not
just the case of cmd=load with kind= some password failure.

Change-Id: I53c959068f5642ae41157e8feb14fd34fc59dc9a
2018-07-11 12:33:42 +03:00
Jan Holesovsky
b65894b287 Avoid crash in the non-wopi case.
Change-Id: I87aff462dab4abca0235622493f720eacbc39f03
Reviewed-on: https://gerrit.libreoffice.org/53448
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 17:01:02 +02:00
Ashod Nakashian
b3bdd5786d wsd: support optional forcing tracking changes at load
Since changing the tracking state is done by toggling,
we need to wait to get the current state at load time
before we can tell whether we need to toggle it or not.

Change-Id: Ib5a2639b2acf3874c191971eedf9a3bebcefebad
Reviewed-on: https://gerrit.libreoffice.org/53415
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 17:00:39 +02:00
Ashod Nakashian
d3d4812583 wsd: localize variables
Change-Id: I411e435fa2360423b4c48d087eb501b942cc637d
Reviewed-on: https://gerrit.libreoffice.org/52419
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-14 16:52:49 +02:00
Tamás Zolnai
347c0705c2 Update dumper code to handle new payload for invalidatecursor
Change-Id: Ibfe129ce4db9ff33d409fb6ebabfb3a435b64829
Reviewed-on: https://gerrit.libreoffice.org/52796
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-04-13 11:14:24 +02:00
Ashod Nakashian
7c2c0062e3 wsd: always avoid saving readonly files
Otherwise saving is bound to fail, causing other
errors, which is nonsensical since there is nothing
to save to begin with.

Change-Id: Icb65a4a3b277b3175aadbe5107b294b24a399e7b
Reviewed-on: https://gerrit.libreoffice.org/50148
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-23 16:55:02 +01:00
Pranav Kant
ad1da235d3 IME support
Dialogs still need to be adapted to this. Only works for documents as of
now.

Change-Id: I0fb1114e279a9e563943f3f65dd5a577523e9841
2018-02-08 14:16:34 +05:30
Pranav Kant
1fabfd9fe3 Version restore states
See documentation

Change-Id: Ica3cd3744643157c5a2c6c1e42e0858ad641da16
2018-02-08 12:30:46 +05:30
Pranav Kant
bd7b2b833c wsd: Don't request closing here, just stop the broker
Asking the doc broker to close means that it will save the current
document to storage before shutting down. But we don't want that because
storing the current document to storage means overwriting the document
which has been changed underneath us.

Change-Id: I8df45d2f0cf3f65936dc3030f483e52fd1703146
Reviewed-on: https://gerrit.libreoffice.org/49134
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2018-02-07 14:44:15 +01:00
Miklos Vajna
1dde430bcf wsd: spell out non-trivial autos to improve readability
Change-Id: I0e1f169fc39e5c722704e1cae487147d929f7350
2018-02-07 10:18:12 +01:00
Ashod Nakashian
b5baf3672f wsd: stop DocBroker using only stop() member
Now always given a proper reason too.

Also, stop polling thread and cleanup when
failing to acquire/spawn a child process.

Change-Id: I7ddee01dd47b8ee72f2d9134c0f1b264634d8611
Reviewed-on: https://gerrit.libreoffice.org/47886
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:03:21 +01:00
Ashod Nakashian
a3a8551f2d wsd: remove lastEditableSession flag
Maintaining a flag is problematic, at least the way
it was reset on adding new sessions. Luckily there
should be no reason for having it, since we should
check it only when removing sessions. Also, we
need to check for every case of removal, and not, as
was, just on disconnection, which is incomplete.

Change-Id: I878766701228c41fc93eeaff21852fa887de9eff
Reviewed-on: https://gerrit.libreoffice.org/47883
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2018-01-15 15:02:27 +01:00
Ashod Nakashian
d53ce5511d wsd: const and cosmetics
Non-functional changes.

Change-Id: I7c52386e2f870d29fd62c6dae6f37f4a58c2396b
Reviewed-on: https://gerrit.libreoffice.org/47882
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-01-15 08:06:56 +01:00
Pranav Kant
f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Pranav Kant
53fc694a3c lokdialog: Use dialog close LOK API when user clicks 'X'
Change-Id: I3a90eb8b83688eed7db8228763633e31f82e58d1
2017-12-05 00:41:19 +05:30
Pranav Kant
849eb0d500 lokdialog: Adapt to LOK dialog API changes
Change-Id: I653304e71573eb253e09a72bc87d54b8554ba7ff
2017-12-04 22:13:50 +05:30
Marco Cecchetti
29a233e5a9 calc: set outline state
use a specific message from the client for set the visibility state of
a group instead of hijacking the update row/column header message

Change-Id: I69d66b30db0b4d8a0082cbd2524120491d4f97cb
Reviewed-on: https://gerrit.libreoffice.org/45446
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-12-01 01:10:43 +01:00
Pranav Kant
a19121bbbc Adapt to dialog API changes in LOK
... and bypass some unncessary DocumentBroker handling of dialog
messages.

Change-Id: I378dff7a9786479baaa43f5fde9d30f35bc7f948
2017-11-28 22:18:21 +05:30
Jan Holesovsky
b20faa8bdc Save As: Advertise the correct size when uploading the new file.
Change-Id: I9b20c4bdb7ddc848437edceae1a77ddb49d55133
Reviewed-on: https://gerrit.libreoffice.org/44357
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-11-10 11:08:53 +01:00
Pranav Kant
f1d78c7e62 lokdialog: send invalidate rectangle in dialog command
Change-Id: Iae00498a0ead1ee65dfce0332721e0d0fd2202fb
Reviewed-on: https://gerrit.libreoffice.org/44518
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-11-09 04:24:24 +01:00