[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/inc vcl/jsdialog vcl/source
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 19 00:17:35 UTC 2021
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 <hcastro at collabora.com>
AuthorDate: Thu Dec 17 10:45:13 2020 -0400
Commit: Henry Castro <hcastro at collabora.com>
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 <hcastro at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109141
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
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();
More information about the Libreoffice-commits
mailing list