diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-05-06 08:16:00 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-05-09 13:58:29 +0200 |
commit | 70e8e788beb122b5779693ecece8f65e27192256 (patch) | |
tree | d6736252493f2294fa64faf648ad28f5644fc97f /desktop/inc/lib | |
parent | bc990b011a928ab55b42361415c6eeb5cb9d172c (diff) |
Allow painting for arbitrary part
Painting should not cause any state changes, but
to paint a tile on a different part than the current
has to change the document, which sends notifications
to all clients.
A new API, paintPartTile, allows for painting tiles
on any part without sending change of part notifications.
Furthermore, because we block notifications during this
operation, no tile invalidation is issued due to
changing of the part.
One issue remains in the cases when the LO Core
resets the cursor position internally and we resume
editing after painting, the cursor might be at the top
of the page. This needs fixing separately.
Change-Id: If19bd1c90ecad4d5ed5e8d09513741b7994fa6e5
Reviewed-on: https://gerrit.libreoffice.org/24698
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'desktop/inc/lib')
-rw-r--r-- | desktop/inc/lib/init.hxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 315f566b0568..3f962ba7f19c 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -33,7 +33,8 @@ namespace desktop { explicit CallbackFlushHandler(LibreOfficeKitCallback pCallback, void* pData) : Idle( "lokit timer callback" ), m_pCallback(pCallback), - m_pData(pData) + m_pData(pData), + m_bPartTilePainting(false) { SetPriority(SchedulerPriority::POST_PAINT); @@ -78,6 +79,13 @@ namespace desktop { void queue(const int type, const char* data) { + if (m_bPartTilePainting) + { + // We drop notifications when this is set. + return; + } + + const std::string payload(data ? data : "(nil)"); std::unique_lock<std::mutex> lock(m_mutex); @@ -145,6 +153,9 @@ namespace desktop { } } + void setPartTilePainting(const bool bPartPainting) { m_bPartTilePainting = bPartPainting; } + bool isPartTilePainting() const { return m_bPartTilePainting; } + private: void flush() { @@ -187,6 +198,7 @@ namespace desktop { std::map<int, std::string> m_states; LibreOfficeKitCallback m_pCallback; void *m_pData; + bool m_bPartTilePainting; std::mutex m_mutex; }; |