include/vcl/window.hxx | 3 +++ vcl/inc/jsdialog/jsdialogbuilder.hxx | 1 + vcl/inc/window.h | 2 ++ vcl/jsdialog/jsdialogbuilder.cxx | 6 ++++++ vcl/source/window/window.cxx | 14 +++++++++++++- 5 files changed, 25 insertions(+), 1 deletion(-)
New commits: commit 2da82bcce699500382eaaec18a228301e17687ca Author: Henry Castro <[email protected]> AuthorDate: Thu Dec 17 10:45:13 2020 -0400 Commit: Henry Castro <[email protected]> CommitDate: Tue Jan 19 01:16:49 2021 +0100 jsdialog: disable idle notify After testing on client side, when showing the Macro Selector Dialog its receive 5 times the same data. So add an option to not use the idle notifier instead it will use the event 'WindowShow'. Change-Id: Ib5657f3c823fc6e998581b99052aaf578d0913e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107893 Tested-by: Jenkins Reviewed-by: Henry Castro <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109141 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 002ca15f01cf..9d6867f94c76 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1206,6 +1206,9 @@ public: /// Find an existing Window based on the LOKWindowId. static VclPtr<vcl::Window> FindLOKWindow(vcl::LOKWindowId nWindowId); + bool IsDisableIdleNotify(); + void SetDisableIdleNotify(bool bValue); + /// check if LOK Window container is empty static bool IsLOKWindowsEmpty(); diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index ccc33b466da8..1cf706f415ec 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -51,6 +51,7 @@ public: void Invoke() override; void ForceUpdate(); void sendClose(); + VclPtr<vcl::Window> getNotifierWindow() { return m_aNotifierWindow; } private: void send(const boost::property_tree::ptree& rTree); diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 89c0ff8cf3b9..bcdc5e20f7ad 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -116,6 +116,8 @@ struct ImplWinData sal_uInt16 mnIsTopWindow; bool mbMouseOver; //< tracks mouse over for native widget paint effect bool mbEnableNativeWidget; //< toggle native widget rendering + bool mbDisableIdleNotify; + ::std::list< VclPtr<vcl::Window> > maTopWindowChildren; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 49cbac450087..141bd9badf6c 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -108,6 +108,9 @@ void JSDialogNotifyIdle::sendClose() { send(generateCloseMessage()); } void JSDialogSender::notifyDialogState(bool bForce) { + if (mpIdleNotify->getNotifierWindow()->IsDisableIdleNotify()) + return; + if (bForce) mpIdleNotify->ForceUpdate(); mpIdleNotify->Start(); @@ -396,6 +399,9 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id, RememberWidget("__DIALOG__", pRet.get()); + if (id == "MacroSelectorDialog") + pDialog->SetDisableIdleNotify(true); + const vcl::ILibreOfficeKitNotifier* pNotifier = pDialog->GetLOKNotifier(); if (pNotifier && id != "MacroSelectorDialog") { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b3f6ce9e9a29..af81dca87fea 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -750,7 +750,8 @@ ImplWinData::ImplWinData() : mnTrackFlags(ShowTrackFlags::NONE), mnIsTopWindow(sal_uInt16(~0)), // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) mbMouseOver(false), - mbEnableNativeWidget(false) + mbEnableNativeWidget(false), + mbDisableIdleNotify(false) { } @@ -3204,6 +3205,17 @@ VclPtr<Window> Window::FindLOKWindow(vcl::LOKWindowId nWindowId) return VclPtr<Window>(); } +bool Window::IsDisableIdleNotify() +{ + return ImplGetWinData()->mbDisableIdleNotify; +} + +void Window::SetDisableIdleNotify(bool bValue) +{ + if (ImplGetWinData()->mbDisableIdleNotify != bValue) + ImplGetWinData()->mbDisableIdleNotify = bValue; +} + bool Window::IsLOKWindowsEmpty() { return GetLOKWindowsMap().empty(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
