[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl vcl/inc vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 4 15:09:01 UTC 2021


 include/vcl/window.hxx               |    3 -
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   17 +---------
 vcl/inc/window.h                     |    2 -
 vcl/jsdialog/jsdialogbuilder.cxx     |   57 ++++-------------------------------
 vcl/source/window/window.cxx         |   14 --------
 5 files changed, 11 insertions(+), 82 deletions(-)

New commits:
commit 809c30d1518bcc3c0ca43ea6f0fda99dcc2016a2
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 30 10:05:26 2020 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Feb 4 16:08:08 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109904
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9d6867f94c76..002ca15f01cf 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1206,9 +1206,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 61447cdeaf2f..f254a5ea3592 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -73,8 +73,7 @@ public:
 
     void notifyDialogState(bool bForce = false);
     void sendClose();
-    void dumpStatus();
-    void sendUpdate(VclPtr<vcl::Window> pWindow);
+    virtual void sendUpdate(VclPtr<vcl::Window> pWindow);
 };
 
 class JSDropTarget final
@@ -151,8 +150,8 @@ public:
                                                             const OUString& rUIFile);
 
     virtual ~JSInstanceBuilder() override;
-    virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id,
-                                                                     bool bTakeOwnership = true) override;
+    virtual std::unique_ptr<weld::MessageDialog>
+    weld_message_dialog(const OString& id, bool bTakeOwnership = true) override;
     virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id,
                                                       bool bTakeOwnership = true) override;
     virtual std::unique_ptr<weld::Label> weld_label(const OString& id,
@@ -239,11 +238,6 @@ public:
 
 class VCL_DLLPUBLIC 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,
@@ -332,11 +326,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 bcdc5e20f7ad..89c0ff8cf3b9 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -116,8 +116,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 2282342239a3..e096209828a6 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -158,8 +158,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)
@@ -169,8 +168,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);
@@ -457,17 +454,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(pDialog ? new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel, pDialog, this, false,
-                                          m_sTypeOfJSON)
-                           : nullptr);
+        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)
         {
             std::stringstream aStream;
             boost::property_tree::ptree aTree = m_aOwnedToplevel->DumpAsPropertyTree();
@@ -497,14 +490,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;
 }
 
@@ -744,12 +737,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)
@@ -770,17 +758,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)
@@ -937,12 +914,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)
@@ -957,21 +929,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 af81dca87fea..b3f6ce9e9a29 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -750,8 +750,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)
 {
 }
 
@@ -3205,17 +3204,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