[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog vcl/source
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 13 07:48:01 UTC 2021
include/vcl/window.hxx | 3 --
vcl/inc/jsdialog/jsdialogbuilder.hxx | 11 -------
vcl/inc/window.h | 2 -
vcl/jsdialog/jsdialogbuilder.cxx | 52 +++--------------------------------
vcl/source/window/window.cxx | 14 ---------
5 files changed, 6 insertions(+), 76 deletions(-)
New commits:
commit 8cbf3938ee3951ef53842bb5664bea6b57828111
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 30 10:05:26 2020 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jan 13 08:47:15 2021 +0100
Revert "jsdialog: disable idle notify"
This reverts commit 71ec214d7583f637fefcb5eca13c637cc6b38029.
and partially 54b5e6b4e083ce7a71e16ef622753898f38dc8ab
freeze/thaw functionality was added so no longer needed.
Change-Id: Iee29fa79bcebfd409fd3cea4f11cb1d48053daa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108509
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index bf4a8790ae25..1a164c0654ed 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1178,9 +1178,6 @@ 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 c31c3e5fa560..2df2aaeb3ad1 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -73,7 +73,6 @@ public:
virtual void notifyDialogState(bool bForce = false);
void sendClose();
- void dumpStatus();
virtual void sendUpdate(VclPtr<vcl::Window> pWindow);
};
@@ -250,11 +249,6 @@ public:
class JSDialog : public JSWidget<SalInstanceDialog, ::Dialog>
{
- DECL_LINK(on_dump_status, void*, void);
- DECL_LINK(on_window_event, VclWindowEvent&, void);
-
- bool m_bNotifyCreated;
-
public:
JSDialog(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
::Dialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership,
@@ -343,11 +337,6 @@ public:
class JSMessageDialog : public SalInstanceMessageDialog, public JSDialogSender
{
- DECL_LINK(on_dump_status, void*, void);
- DECL_LINK(on_window_event, VclWindowEvent&, void);
-
- bool m_bNotifyCreated;
-
public:
JSMessageDialog(::MessageDialog* pDialog, VclPtr<vcl::Window> aContentWindow,
SalInstanceBuilder* pBuilder, bool bTakeOwnership);
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index a6d46c41eeda..a14852ca02c0 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -117,8 +117,6 @@ 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 f33d0be85fd5..df2d68e71c16 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -159,8 +159,7 @@ void JSDialogNotifyIdle::sendClose() { send(*generateCloseMessage()); }
void JSDialogSender::notifyDialogState(bool bForce)
{
- auto aNotifierWnd = mpIdleNotify->getNotifierWindow();
- if (aNotifierWnd && aNotifierWnd->IsDisableIdleNotify())
+ if (!mpIdleNotify->getNotifierWindow())
return;
if (bForce)
@@ -170,8 +169,6 @@ void JSDialogSender::notifyDialogState(bool bForce)
void JSDialogSender::sendClose() { mpIdleNotify->sendClose(); }
-void JSDialogSender::dumpStatus() { mpIdleNotify->Invoke(); }
-
void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow)
{
mpIdleNotify->updateStatus(pWindow);
@@ -461,16 +458,13 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id)
m_xBuilder->drop_ownership(pDialog);
m_bHasTopLevelDialog = true;
- if (id == "MacroSelectorDialog")
- pDialog->SetDisableIdleNotify(true);
-
pRet.reset(
new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel, pDialog, this, false, m_sTypeOfJSON));
RememberWidget("__DIALOG__", pRet.get());
const vcl::ILibreOfficeKitNotifier* pNotifier = pDialog->GetLOKNotifier();
- if (pNotifier && id != "MacroSelectorDialog")
+ if (pNotifier)
{
tools::JsonWriter aJsonWriter;
m_aOwnedToplevel->DumpAsPropertyTree(aJsonWriter);
@@ -497,14 +491,14 @@ std::unique_ptr<weld::MessageDialog> JSInstanceBuilder::weld_message_dialog(cons
assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
m_aOwnedToplevel.set(pMessageDialog);
m_xBuilder->drop_ownership(pMessageDialog);
-
- if (id == "MacroWarnMedium")
- pMessageDialog->SetDisableIdleNotify(true);
}
pRet.reset(pMessageDialog ? new JSMessageDialog(pMessageDialog, m_aOwnedToplevel, this, false)
: nullptr);
+ if (pRet)
+ RememberWidget("__DIALOG__", pRet.get());
+
return pRet;
}
@@ -715,12 +709,7 @@ JSDialog::JSDialog(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aCon
std::string sTypeOfJSON)
: JSWidget<SalInstanceDialog, ::Dialog>(aNotifierWindow, aContentWindow, pDialog, pBuilder,
bTakeOwnership, sTypeOfJSON)
- , m_bNotifyCreated(false)
{
- if (aNotifierWindow && aNotifierWindow->IsDisableIdleNotify())
- {
- pDialog->AddEventListener(LINK(this, JSDialog, on_window_event));
- }
}
void JSDialog::collapse(weld::Widget* pEdit, weld::Widget* pButton)
@@ -741,17 +730,6 @@ void JSDialog::response(int response)
SalInstanceDialog::response(response);
}
-IMPL_LINK_NOARG(JSDialog, on_dump_status, void*, void) { JSDialogSender::dumpStatus(); }
-
-IMPL_LINK(JSDialog, on_window_event, VclWindowEvent&, rEvent, void)
-{
- if (rEvent.GetId() == VclEventId::WindowShow && !m_bNotifyCreated)
- {
- Application::PostUserEvent(LINK(this, JSDialog, on_dump_status));
- m_bNotifyCreated = true;
- }
-}
-
JSLabel::JSLabel(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow,
FixedText* pLabel, SalInstanceBuilder* pBuilder, bool bTakeOwnership,
std::string sTypeOfJSON)
@@ -908,12 +886,7 @@ JSMessageDialog::JSMessageDialog(::MessageDialog* pDialog, VclPtr<vcl::Window> a
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
: SalInstanceMessageDialog(pDialog, pBuilder, bTakeOwnership)
, JSDialogSender(m_xMessageDialog, aContentWindow, "dialog")
- , m_bNotifyCreated(false)
{
- if (aContentWindow && aContentWindow->IsDisableIdleNotify())
- {
- pDialog->AddEventListener(LINK(this, JSMessageDialog, on_window_event));
- }
}
void JSMessageDialog::set_primary_text(const OUString& rText)
@@ -928,21 +901,6 @@ void JSMessageDialog::set_secondary_text(const OUString& rText)
notifyDialogState();
}
-IMPL_LINK_NOARG(JSMessageDialog, on_dump_status, void*, void) { JSDialogSender::dumpStatus(); }
-
-IMPL_LINK(JSMessageDialog, on_window_event, VclWindowEvent&, rEvent, void)
-{
- if (rEvent.GetId() == VclEventId::WindowShow && !m_bNotifyCreated)
- {
- Application::PostUserEvent(LINK(this, JSMessageDialog, on_dump_status));
- m_bNotifyCreated = true;
- }
- else if (rEvent.GetId() == VclEventId::WindowHide || rEvent.GetId() == VclEventId::WindowClose)
- {
- sendClose();
- }
-}
-
JSCheckButton::JSCheckButton(VclPtr<vcl::Window> aNotifierWindow,
VclPtr<vcl::Window> aContentWindow, ::CheckBox* pCheckBox,
SalInstanceBuilder* pBuilder, bool bTakeOwnership,
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index d897e94a0bea..755a17127634 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -755,8 +755,7 @@ ImplWinData::ImplWinData() :
mnTrackFlags(ShowTrackFlags::NONE),
mnIsTopWindow(sal_uInt16(~0)), // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
mbMouseOver(false),
- mbEnableNativeWidget(false),
- mbDisableIdleNotify(false)
+ mbEnableNativeWidget(false)
{
}
@@ -3202,17 +3201,6 @@ 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