diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-14 16:11:55 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-19 17:44:34 +0100 |
commit | bac26f91ae930902c336b1e5ceb08e1ae5de8d8a (patch) | |
tree | dc1a77465eff0a3835acf7f7491b52d5ee5ef421 | |
parent | 325bab6a92921a0356cc3e1c66f14ad0c6200d85 (diff) |
lok: masterpage: disable callbacks on painting
We did that only for original view, but we need to disable
callbacks for used view - so when we switch mode or part it
will not send the notification to the client.
Bug fixed by this patch:
1. open impress in two LOK sessions
2. A enters MasterPage mode
3. B switched slide
4. A exits MasterPage mode
result: A was switched to the slide selected by B
Change-Id: I7dde8bb4c73862813d064319922aba4c4b727db9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142716
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ash@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142966
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 41f05517082f..1163ef2a638f 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3817,7 +3817,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, { // Text documents have a single coordinate system; don't change part. int nOrigPart = 0; - const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT); + const int aType = doc_getDocumentType(pThis); + const bool isText = (aType == LOK_DOCTYPE_TEXT); int nViewId = nOrigViewId; int nLastNonEditorView = nViewId; if (!isText) @@ -3853,6 +3854,14 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, doc_setView(pThis, nLastNonEditorView); } + // Disable callbacks while we are painting - after setting the view + if (nViewId != nOrigViewId && nViewId >= 0) + { + const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nViewId); + if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) + handlerIt->second->disableCallbacks(); + } + nOrigPart = doc_getPart(pThis); if (nPart != nOrigPart) { @@ -3880,6 +3889,13 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } if (!isText && nViewId != nOrigViewId) { + if (nViewId >= 0) + { + const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nViewId); + if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) + handlerIt->second->enableCallbacks(); + } + doc_setView(pThis, nOrigViewId); } } |