diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2022-05-20 19:16:03 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2022-05-20 22:26:15 +0200 |
commit | 55f65c4d6cf7d1f68fe9c39c42431e6a15d903e6 (patch) | |
tree | e447d6a424a212f8846c4d827768ee2f7706dbab | |
parent | 11dd8edeafb6ed237698149dd0f679851fbbce0b (diff) |
lok: sidebar: avoid async call to switch context
This makes us sure we don't trigger actions for other views
in LOK case.
We need to call Sync() after RequestCall() so it will be executed
synchronously.
Change-Id: I07af8d34cbbc6bb42e1b8eeef47a921fdc4bf5f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134689
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index db4f9679e34a..ba1c968d022f 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -332,8 +332,9 @@ void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::Contex maContextChangeUpdate.RequestCall(); // async call, not a prob // calling with held // solarmutex - // TODO: this call is redundant but mandatory for unit test to update context on document loading - if (!comphelper::LibreOfficeKit::isActive()) + if (comphelper::LibreOfficeKit::isActive()) + maContextChangeUpdate.Sync(); + else // TODO: this call is redundant but mandatory for unit test to update context on document loading UpdateConfigurations(); } } @@ -373,6 +374,8 @@ void SAL_CALL SidebarController::statusChanged (const css::frame::FeatureStateEv mnRequestedForceFlags |= SwitchFlag_ForceSwitch; maContextChangeUpdate.RequestCall(); // async call, ok to call // with held solarmutex + if (comphelper::LibreOfficeKit::isActive()) + maContextChangeUpdate.Sync(); } } @@ -1028,6 +1031,8 @@ IMPL_LINK(SidebarController, WindowEventHandler, VclWindowEvent&, rEvent, void) mpParentWindow->Invalidate(); mnRequestedForceFlags |= SwitchFlag_ForceNewDeck | SwitchFlag_ForceNewPanels; maContextChangeUpdate.RequestCall(); + if (comphelper::LibreOfficeKit::isActive()) + maContextChangeUpdate.Sync(); break; case VclEventId::ObjectDying: |