diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-09-09 21:55:12 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-09-10 19:31:57 +0000 |
commit | 7038a05224c88c58c5889dd1b7d70a8511f96f6a (patch) | |
tree | 2dd45bd8bcd4db18ca4d422d0ef5f54ff6ad4f3e /desktop/inc | |
parent | 785a7e58c4029dc36b624ef709e790f2fdaddee8 (diff) |
LOK: new callback dropping implementation
Now view callbacks have their own collection of last states where the
key is made up by both the view id and the callback type.
Callback dropping based on the last state is no more handled on
queueing but on flushing, since what really matters is the last
performed callback (for each callback type).
Anyway in order to not modify the order of callbacks, that could be
changed when an already queued callback is superseeded, dropping still
occurs on queuing too, just by looking for the last queued callback of
the same type.
The result is a substantial reduction of redundant callbacks and fix
the following problem in loleaflet: when there are more views for a
speadsheet and cell cursors for two view are placed on the same cell,
a continuos swapping between the two cell cursors can occur. That was
due to a sequence of "EMPTY" and coordinates messages or cell cursor
and cell view cursor messages which were sent in an alternating way.
Change-Id: I79e14d11d4e8590aff715181e3410ad88c4e6175
Reviewed-on: https://gerrit.libreoffice.org/28783
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'desktop/inc')
-rw-r--r-- | desktop/inc/lib/init.hxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 0d019975a090..db281688c2f9 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -11,6 +11,7 @@ #define INCLUDED_DESKTOP_INC_LIB_INIT_HXX #include <map> +#include <unordered_map> #include <memory> #include <mutex> @@ -46,6 +47,9 @@ namespace desktop { void setPartTilePainting(const bool bPartPainting) { m_bPartTilePainting = bPartPainting; } bool isPartTilePainting() const { return m_bPartTilePainting; } + void addViewStates(int viewId); + void removeViewStates(int viewId); + typedef std::vector<std::pair<int, std::string>> queue_type; private: @@ -54,6 +58,7 @@ namespace desktop { queue_type m_queue; std::map<int, std::string> m_states; + std::unordered_map<int, std::unordered_map<int, std::string>> m_viewStates; LibreOfficeKitDocument* m_pDocument; LibreOfficeKitCallback m_pCallback; void *m_pData; |