Commit graph

2455 commits

Author SHA1 Message Date
Ashod Nakashian
c37d6720fd loleaflet: remove text selection when inactive
Change-Id: I5e983062a39d50b45435af6f1cc51073f1c31e7e
Reviewed-on: https://gerrit.libreoffice.org/24315
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-23 13:27:39 +00:00
Tor Lillqvist
f46855eb25 It is not a cause for warning if we are removing a file
Use info() instead. Also, only log the info if the file actually
existed and was removed. We don't want misleading noise logging about
removing files that were not there. Use std::remove() directly to
avoid unnecessary layers that just make it harder to know whether the
removal worked or not.
2016-04-22 17:50:25 +03:00
Tor Lillqvist
c80b7388ed The JS client never sends any 'invalidatetiles' 2016-04-22 17:50:25 +03:00
Tor Lillqvist
7d2a1d9048 I always keep doing 'make cache-clean' 2016-04-22 17:50:25 +03:00
Tor Lillqvist
bff5748cd9 No need to have separate "editing" and "persistent" tile caches
All changes are supposed to be persistent. This simplifies the tile
caching code quite a lot.

The TileCache object no longer needs to keep any state whether the
document is being edited or whether it has been modified without
saving etc.

Update the modtime.txt file after saving the document. Otherwise the
tile cache would wrongly be considered invalid next time.

As a sanity check, we put a flag file 'unsaved.txt' into the cache
directory whenever we get a callback that indicates the document has
been modified, and remove it when the document is saved. If the flag
file is present when we take an existing tile cache into use, we can't
trust it.

Even after these changes, we still don't use an existing tile cache as
much (or at all?) as we could, though. The INVALIDATE_TILES EMPTY
callback that LO does early on in a conection causes us to remove all
cached tiles...
2016-04-22 17:49:39 +03:00
Tor Lillqvist
b0cfa35018 Remove accidental superfluous indentation 2016-04-22 13:26:32 +03:00
Tor Lillqvist
4aaf70bf8e The logging goes to stderr, not stdout
Check whether stderr goes to a terminal, not whether stdout does.
2016-04-22 13:24:35 +03:00
Michael Meeks
60ffc8aa6b Avoid tile subscription loop, and elide redundant tile subscriptions. 2016-04-22 07:58:31 +01:00
Miklos Vajna
0833a99b37 TileCache: avoid copying these for each invocation
Change-Id: Icaf84699d7f54f2f977162a040aed1f4090f680d
2016-04-22 08:39:16 +02:00
Ashod Nakashian
9e64efe78b loleaflet: don't communicate with WSD when inactive to avoid confusing it
Change-Id: I4c7f252264fba4a46c6be9e9592a2aec165813bd
Reviewed-on: https://gerrit.libreoffice.org/24289
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-22 04:37:57 +00:00
Ashod Nakashian
3a4c02b71d loolwsd: track important notifications not sent to inactive clients
These notifications are important to be sent once the user
becomes active again to sync their view with the latest.

Change-Id: Id8f9fff83eea888cdcc8d6ed1d4f12111de39a6e
Reviewed-on: https://gerrit.libreoffice.org/24288
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-22 04:36:51 +00:00
Ashod Nakashian
bde67c9934 loolwsd: track document modified state to avoid unnecessary auto-saving
This also avoids the feedback loop that results from the kit
thinking the previously inactive client is now active and
sending commands (.uno:Save).

Change-Id: I47074b35a922da15592d550032d494ba1efab83e
Reviewed-on: https://gerrit.libreoffice.org/24287
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-22 04:36:02 +00:00
Ashod Nakashian
f83cc22db9 Documentation update for 'useractive' and 'userinactive'.
Change-Id: I4e2f0923aa5d0f35c29c752b144e23b365e73bb0
Reviewed-on: https://gerrit.libreoffice.org/24279
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-21 13:03:06 +00:00
Jan Holesovsky
22e8f8b1fe loleaflet: Group tile requests into rectangular areas, and call tilecombine.
Instead of asking for individual tiles, try to find rectangular areas in the
tile requests, and ask for the large rectangles using tilecombine, instead of
asking for individual tiles.
2016-04-21 12:14:32 +02:00
Jan Holesovsky
4a21e21627 loleaflet: Split the DOM handling from the actual asking for tiles. 2016-04-21 12:14:32 +02:00
Jan Holesovsky
a11aa8565c loleaflet: Change _addTile to _addTiles, and pass the entire queue. 2016-04-21 12:14:32 +02:00
Jan Holesovsky
538c1f571d loleaflet: Don't create the message if not necessary. 2016-04-21 12:14:32 +02:00
Jan Holesovsky
d8741d5ec3 loleaflet: Remove code for prefetching in other parts.
Not that a typical use case I'm afraid, and trying to switch parts for
prefetching was causing trouble in the past anyway.
2016-04-21 12:14:32 +02:00
Tor Lillqvist
232499f542 Add test that simultaneously requested tiles indeed were rendered just once
This test requires the renderid parameter to be present in the 'tile:'
response messages, and that is the case only when ENABLE_DEBUG, so we
can run the test only in a debug build.
2016-04-21 12:50:24 +03:00
Tor Lillqvist
95278b8643 Don't just re-use the 'tile:' response as a 'tile' request
In a debug build it contains also the parameter renderid. (And in the
future, might be extended in other ways, too.) Construct a new request
message that has exactly and only the parameters we want.
2016-04-21 12:42:53 +03:00
Tor Lillqvist
d446822fb3 Add some more logging for tile cache management 2016-04-21 12:42:53 +03:00
Jan Holesovsky
06366c2e4c Fix build. 2016-04-21 11:36:47 +02:00
Andras Timar
a6969c8827 document --admincreds and --allowlocalstorage in loolwsd.service 2016-04-21 11:22:22 +02:00
Andras Timar
745edddbe8 spec file extended for Fedora/CentOS 2016-04-21 10:14:29 +02:00
Miklos Vajna
9059774e64 LOOLTool: fix potential memory leak
Change-Id: Ib1c9bb5cbbef709882580de40500c1a9c8f70e4a
2016-04-21 08:37:27 +02:00
Ashod Nakashian
5fbaa8f3d2 loolwsd: useractive and userinactive command support
loleaflet can now send userinactive when the user
has switched tabs or the browser window loses
focus. Similarly, it can send useractive when
focus is regained.

Change-Id: Id3186949b10a8263e29ada1a790d3123a79e8f08
Reviewed-on: https://gerrit.libreoffice.org/24272
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-21 05:31:18 +00:00
Ashod Nakashian
b0701733fa loleaflet: leaflet is dimmed after losing focus by 10s and Online notified
Change-Id: I0ed38e89c6dbd4f7325a81cc49b3b37de65c0ea0
Reviewed-on: https://gerrit.libreoffice.org/24271
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-21 05:17:24 +00:00
Henry Castro
40daf0185a loolwsd: test: discovery 2016-04-20 23:09:04 -04:00
Henry Castro
11fbb33b56 loolwsd: test: simulate lokit crash test 2016-04-20 21:14:51 -04:00
Michael Meeks
9d913f986b Use size_t for iterating tokens. 2016-04-20 20:47:00 +01:00
Tor Lillqvist
5a509f9211 In a debug build, say in the tile: reponse also whether it was found in cache
Also, do the construction of the response string in
MasterProcessSession::sendTile() only when it is actually going to be
used.
2016-04-20 18:54:18 +03:00
Tor Lillqvist
842525c25c Guard against mixing up cout output from separate threads 2016-04-20 18:54:18 +03:00
Tor Lillqvist
77a91c4b2e In debug builds append a renderid=<unique-id> token to tile: responses
Will be used in unit test to verify that several clients of the same
document asking for the same tile simultaneously indeed do cause just
one tile rendering to take place.
2016-04-20 18:54:17 +03:00
Tor Lillqvist
7b47548020 Add getToken* variants that iterate over a StringTokenizer
If any of the tokens in the string matches name=<value> for the name
in question, store that value and return true. Otherwise return false.
2016-04-20 18:54:17 +03:00
Tor Lillqvist
d423f7c2fd Add Util::UniqueId() to get a string id that is unique across processes and calls 2016-04-20 18:54:17 +03:00
Tor Lillqvist
e94e8344ad IIUC, the 'tile' and 'tile:' messages have an optional timestamp parameter 2016-04-20 18:54:17 +03:00
Tor Lillqvist
9499071707 Change comment to make sense 2016-04-20 18:54:17 +03:00
Pranav Kant
769c0591ed bccu#1656: Scroll when you are at the bottom of the screen
Change-Id: Id78ee3ad75bc2f1f3781c3e8ede9d4262e46a0f9
2016-04-20 20:27:57 +05:30
Pranav Kant
616cb5f451 bccu#1689: Show a popup when non-editlock view tries to edit
Show a popup on 'mousedown' and 'keypress' events for
non-editlock modes.

Change-Id: I3a8a964d6a507549f521f3f831a4c623d202c86c
2016-04-20 16:50:36 +05:30
Pranav Kant
14b672bf5f bccu#1707: Do not mix editlock with permissions
For some reason, text cursor gets stuck making it impossible to
type in the document. This only happens with firefox + owncloud.

Lets keep the editlock state separately in map, and do not yet
mix the permissions with editlock state.

Change-Id: If4193d08b7228cde510321ec5b4c892b8617d8a7
2016-04-20 16:50:36 +05:30
Andras Timar
028becc511 error: unused parameter ‘part’ [-Werror=unused-parameter] 2016-04-20 13:00:43 +02:00
Jan Holesovsky
97342a2817 bccu#1653: Make the .html's, .css's and .js's versioned.
It is still possible to access them directly via loleaflet/dist/<something>,
but such use can lead to unexpected behaviour due to various caching in the
browsers etc.
2016-04-20 12:58:10 +02:00
Michael Meeks
a47355db2f Expand use of the TileBeingRendered structure.
Implement this for tilecombine, and do tile writes in each client's
thread separately. Add env-var. to trigger sleep, and tune it to 1
second; easily long enough to exercise this code-path.
2016-04-20 11:14:18 +01:00
Andras Timar
14458095ad README: loolwsd's --test option was binned 2016-04-20 12:00:46 +02:00
Andras Timar
59aa99d08d typo: consistenly -> consistently 2016-04-20 11:51:28 +02:00
Andras Timar
f0549f8ba1 document --disable-ssl and related stuff 2016-04-20 11:48:12 +02:00
Andras Timar
af36a3bd13 document --allowlocalstorage and --admincreds 2016-04-20 11:35:31 +02:00
Pranav Kant
4fb1f60e06 Treat minified files as binary files
Helps 'git grep' do its job better.

Change-Id: Ia3c671df471d7ee4545aff3ea96c2bc104d0d025
2016-04-20 14:32:16 +05:30
Tor Lillqvist
2d74d65578 Rant about the duplicate specification of document URI, GET and 'load' 2016-04-20 10:35:38 +03:00
Miklos Vajna
5e2937bf79 Log: strcpy -> strncpy
Change-Id: I2929ad46b422e6e55e198064c2930028df844630
2016-04-20 09:10:30 +02:00