Commit graph

23900 commits

Author SHA1 Message Date
Skyler Grey
d9168d447f fix(pan): Make screen edge offset document
Similarly to I1a2060d44d3b75935bf138056330a52d56a028ae, I have made
panning past the document edge create an offset too. This provides
similar benefits to the fluidity of scrolling at document edges.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I2eedf2449620c5c8fec9ebf71dbe23d5a643ad5c
2024-05-15 10:07:05 +02:00
Skyler Grey
9a73b20731 fix(zoom): Make screen edge offset document
Zooming always leads to same backwards and forwards, even when you have
hit the screen edge. At the edge of the screen, you can move no further,
which causes the illusion of it being "sticky" on the return journey.

By adding an offset when we reach the edge, we can avoid the stickiness.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I1a2060d44d3b75935bf138056330a52d56a028ae
2024-05-15 10:07:05 +02:00
Michael Meeks
dbe905de8c bgsave: enable by default again.
Seems we have closed a number of the various races and problems
seen, and this can now be used.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie3b0a1de847b9e77820d1135b4a8facdb7934707
2024-05-14 21:28:18 +01:00
Michael Meeks
c4b4af5959 bgsave: filter statechanged messages from the bgsave process.
We don't want to send these to coolwsd, they have confusingly
different Modified state from the bgsave process - which is now
unmodified after save.

Really we should filter out almost all messages from the
bgsave process and not forward them.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ifaea028f080e31705256a2d72cf4ab03dfd94187
2024-05-14 21:28:18 +01:00
Michael Meeks
8f49f23a03 bgsave: update test for faster and more reliable modified status.
Requires core change: https://gerrit.libreoffice.org/c/core/+/167635

Change-Id: I7a7cf969e5018e8a7b70797450571d4c39b977d8
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-14 21:28:18 +01:00
Caolán McNamara
30e064907d explain the relationship of global and bundle 'onopen' handlers
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5cba504273d4fd035a918839001ccb91976ccb16
2024-05-14 22:16:14 +02:00
Gökay Şatır
96e6eec12f Remove some unused lines.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I24686166eadfff8622e10bddaa4893ed821191eb
2024-05-14 22:12:57 +02:00
Gökay Şatır
571a066eca Convert cellSelectionArea into simpleRectangle.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ib3289dca84d02b7171db2e41f33dd18ba87c0cbf
2024-05-14 22:11:55 +02:00
Gökay Şatır
d80689e551 Improve section definitions.
Remove createSection from CanvasSectionContainer.
Use extended classes.
Move some of the sections to their own files.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: If80e86f55920f80d9fb1fddef49ac451ed744b7c
2024-05-14 22:11:01 +02:00
Caolán McNamara
ef64f815af reuse dns caching for resolveHostAddress too
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8df71340f2c80a1dd19fd422b20f350b2755e22c
2024-05-14 22:09:49 +02:00
Caolán McNamara
5be3ccc871 cache DNS results for 20 seconds
querying capibilities happens frequently:

ClientRequestDispatcher: :allowConvertTo
ClientRequestDispatcher: :getCapabilitiesJson
ClientRequestDispatcher: :handleCapabilitiesRequest
ClientRequestDispatcher: :handleIncomingMessage
StreamSocket: :handlePoll
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I6feb535a91f4ccc647b172da27284f26f55c3e27
2024-05-14 22:09:49 +02:00
Caolán McNamara
d42798abc6 initial dark mode not always set
typically can be seen on a fast connection to a NextCloud instance

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie3431d58cb2499464e1bfac95dcf3b981536a7a2
2024-05-14 20:27:44 +01:00
Michael Meeks
0c7cb448ca cypress and C++ tests: enable full trace logging to keep timing the same.
It appears that both cypress and the C++ WOPI tests are extremely
timing sensitive, and fixing this should not hold up merging the
logging improvements. So for now don't disable logging in these modes.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I43e8397263e6960b668a29e7ad67f45394c52b52
2024-05-14 18:37:52 +02:00
Michael Meeks
b95e4d8424 Logging: annotate WebSocket, Admin and cleanup Forkit.
Significantly calmer and less frenzied logging output.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I0f1782c0b8f10ac3427bac479ded2862f2b40b7a
2024-05-14 18:37:52 +02:00
Michael Meeks
3746a51479 Logging: calm down the most prolific Socket logging sites.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia2ba1f114397cf8f61a4e42bdf55bdf4c0ac969a
2024-05-14 18:37:52 +02:00
Michael Meeks
9b6ab4c601 Logging: add Area parameter and new LOGA_ macros to annotate areas.
Add logging.disabled_areas setting to coolwsd.xml with some sensible
things to ignore unless they are warnings/errors.

Kit code duplication around logging is grim; but not fixed in this
commit.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I36bebb2b3c8d64a814d7b10c167d582de0baf4e5
2024-05-14 18:37:52 +02:00
Henry Castro
3cc17d6583 browser: fix doclayer de-reference
Change-Id: Ibea3a7dc30f8e948044cb513ff4f54166a50d162
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-05-14 16:44:40 +01:00
Michael Meeks
ff8dbe7fde cool#9045 - close clipboard race by waiting for completion.
To avoid the HTTP[S] request racing the websocket and sometimes
loosing we need to:

* get a notification from the Kit when the copy / cut is complete
* wait on a Promise for this, to allow the HTTP fetch to start
* re-work to do a single, rather than two fetches by sharing
  the download promise.

Change-Id: Ic23f7f817cc855ff08f25a2afefcd73d6fc3472b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-14 13:19:52 +02:00
Miklos Vajna
0ef5e740a4 fuzzer, clientsession: fix build
Probably went wrong in commit de985834e2
(wsd: simplify DocumentBroker construction, 2024-04-03).

Also init logging to avoid:

common/Log.cpp:664:16: runtime error: downcast of address 0x6070000005d0 which does not point to an object of type 'GenericLogger'
0x6070000005d0: note: object is of type 'Poco::Logger'

similar to how COOLWSD::innerInitialize() does it.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic16bb2f070e1f0e12204bcc2fc70303d8c1250c8
2024-05-13 08:29:07 +01:00
Caolán McNamara
60598961cd cid#318908 Uninitialized scalar field
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I70e1a5cdec637fc92cab294953599afe667a55cd
2024-05-13 08:44:03 +02:00
Caolán McNamara
95fcde9ddd cid#365245 Uninitialized pointer field
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I1fedbde5715f2adb0218bf61ae7014797fb43990
2024-05-13 08:44:03 +02:00
Caolán McNamara
c46df319ec cid#366099 Uninitialized pointer field
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I30949ae9a944a1c254c24a49519b22cf6202a14f
2024-05-13 08:44:03 +02:00
Neil Guertin
6bc7e3a356 Fix mobile/impress/apply_font_text_spec.js
Stabilize test by removing lots of extra shape selection
Stabilize "Apply highlight on selected text" by waiting before
color picker.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I60e5e571be181bd6f43db1727854973aca446b99
2024-05-12 11:47:22 -04:00
Michael Meeks
1c4d71a974 cool#8747 - disable un-necessary fsync'ing.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4d1a041f94ead329d9973aaacd85f40001417cf2
2024-05-11 19:31:33 +01:00
Ashod Nakashian
7d90faf2e4 wsd: serve all files through sts
Change-Id: I16b4d2a93ab5ec6f2a277b1b2e6be61c3515c2c8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-11 14:37:00 +02:00
Ashod Nakashian
e546a5c602 wsd: refactor hsts header
Change-Id: I153e148bcbf9c0675d24a0b65314c6ffe4c74313
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-11 14:37:00 +02:00
Gökay Şatır
e06bc471ef Remove unused code and CSS rules.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ie5ba30b4080770e51c37e1266e1613c169e58cfa
2024-05-10 22:11:29 +03:00
Gökay Şatır
717e837211 Use simpleRectangle for docLayer._graphicSelection.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ibc84782abf8e7668d31360e106fc73522fcd4494
2024-05-10 22:11:09 +03:00
Michael Meeks
3feb7fe58c bgsave: don't process left-over tile messages from the KitQueue.
If we had a tilecombine processed in the same queue and before
a save - the 'render tiles at the end' state would be inherited by
the background save process and result in excess work, and also
binary messages where only text messages are expected returning.

The rest of the queue is cleared post fork.

Add unit test - plus hook to hold queue processing.

Change-Id: Iee937897000bc3ac149599844f1eab005affb131
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-05-10 16:30:37 +01:00
Michael Meeks
fff63bec45 Forkit needs to wakeup to waitpid processes.
This should cleanup jails more quickly.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I2f7c7753614f0845a4d81d69334834047d661e41
2024-05-10 16:30:37 +01:00
Michael Meeks
8b7549b8f7 bgsave: lower priority of background thread.
Free CPU cycles for interactive processes.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I9d8cfe5f3541c9424d51c69380e1c72920154ff4
2024-05-10 16:30:37 +01:00
Caolán McNamara
34b75306c3 AddressSanitizer: memcmp issue
/usr/bin/coolforkit
	memcmp
		asan/../sanitizer_common/sanitizer_common_interceptors.inc:875 (discriminator 9)
/usr/bin/coolforkit
	(anonymous namespace)::textItem(std::vector<char, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool&)
		online/kit/KitQueue.cpp:52
/usr/bin/coolforkit
	KitQueue::put(std::vector<char, std::allocator<char> > const&)
		online/kit/KitQueue.cpp:94

since:

commit f8a0d6c086
Date:   Thu May 9 15:29:49 2024 +0100

    Callbacks: minor efficiency wins, avoid tokenizing where we can.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie5d0f86bb33c810b6a5f177421485c977b7fc79a
2024-05-10 16:16:49 +02:00
Henry Castro
15338e91c3 browser: preview: replace meta preview place holder
It is required to initial preview place holder,
otherwise, there are some cases that the server takes
time to serve preview_placeholder.svg and it may cause
an ugly effect.

Change-Id: I70ac46c8c464b64a09f091cdf5f8644d208a79d4
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-05-10 14:58:19 +01:00
Henry Castro
95e8ea0a95 browser: preview: remove unused code
Change-Id: I1ebf8611b898f52209fd6d4a6f20a749cbb05e07
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-05-10 14:58:19 +01:00
Henry Castro
511bd3b7c6 browser: preview: simplify _onScroll function
Change-Id: I4bf06c92299af5375f01a5be63bb95268257be1c
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-05-10 14:58:19 +01:00
Michael Meeks
d4d4731136 Cleanup condition check for a quick poll.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ica75605d3a12e7eae86cc0e4cbebb722aef92919
2024-05-09 17:47:15 +01:00
Michael Meeks
f8a0d6c086 Callbacks: minor efficiency wins, avoid tokenizing where we can.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I2ef647fd0af7bc83b7b40fd3ce7a49dc799f4339
2024-05-09 17:47:15 +01:00
Michael Meeks
6f49f9398e Split outbound callback processing from incoming message queueing.
Now we always send callbacks as soon as possible back to wsd from the
kit. This has several implications:

1. even when InputProcessing is disabled we will send outbound
   progress updates.
2. we should send callbacks much more quickly without waiting for
   other queue events to be processed eg. tilecombine:

We also drastically simplify storage of callbacks, avoiding lots of
re-parsing of the same strings, and allow much more efficient
comparison and merging at a small space cost in queue size.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia1ede5406767f895616a52775316ee6ab1c5db09
2024-05-09 17:47:15 +01:00
Michael Meeks
320606c225 KitQueue - remove more un-necessary code, and helper use.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ic11db8ac1391bd22b4adcae40c99fa4ca99790f1
2024-05-09 17:47:15 +01:00
Gökay Şatır
70ff910f20 Fix variable type error in "setDesktopCalcViewOnZoom" function.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Idcd7040271e26bad4d04921bcb19dfb0ed45169b
2024-05-09 18:24:47 +03:00
Ashod Nakashian
6f725087a1 mount: remove test-mount directory
Change-Id: Iff128a22ac7d0fa3e6514e62e1f4ea92a60f052b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-09 15:32:26 +02:00
Ashod Nakashian
b33f822871 wsd: mount: safeRemoveDir will not error when unmount fails
safeRemoveDir is tries to unmount blindly, so there
is little point in erroring when the directory
in question isn't a mount-point at all.

Change-Id: I6db0fd9406493060ce52a69f7d935b0958e2d2be
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-09 15:32:26 +02:00
Ashod Nakashian
dac5c0341f mount: avoid hard-coding
Change-Id: I6857510a9d0442cc357886b453d369f1e4b8f53f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-09 15:32:26 +02:00
Ashod Nakashian
4d8d1119a2 mount: reduce failure noise
Change-Id: I2709a4a220f6d1db42e5259e0a883d4c74066bef
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-05-09 15:32:26 +02:00
Neil Guertin
5a9c6a0e37 Cypress: Add cypress-terminal-report printLogsToConsole option
This is already the default behavior. Writing it here just
makes it easier to change.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iebde47f5b64ae1509e7f37b884ad71fdc067b164
2024-05-09 08:27:42 -04:00
Neil Guertin
982f865cc7 Skip failing test desktop/writer/invalidations_spec.js
Test is failing because of an extra empty invalidation
when clicking between the body and the header

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I887c9bc028f2b831d205bba2944c734cafb1743d
2024-05-09 08:27:37 -04:00
Gökay Şatır
62239215da Update the test for now - it omits visibility check.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I9c55379afa9175360e16e036e7620b83168ce9f8
2024-05-09 13:28:54 +03:00
Gökay Şatır
e0e5a6a418 Cypress updates.
Change the cell selection circle color in dark mode.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I23826bdf0a09fa7e8b1c25132842f98e37997034
2024-05-09 13:28:54 +03:00
Gökay Şatır
9b3038c70f Initialize CanvasSectionContainer as soon as the canvas HTML element is initialized.
Move section definitions under canvas initialization.
Use app.sectionContainer instead of painter_sectionContainer.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ie10bfa36fca30bd1dda42adab2bbf2a16c418717
2024-05-09 13:28:54 +03:00
Gökay Şatır
f64521caa1 Fix indentation.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I9b5334ee7b8178503eef7c4790acb8a5ac1f8340
2024-05-09 13:28:54 +03:00