sfx2/source/sidebar/SidebarController.cxx |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 52bfa7294ce18456c6285ed4897e0ed318dbb98e
Author:     Ashod Nakashian <ashod.nakash...@collabora.co.uk>
AuthorDate: Wed Dec 11 12:23:08 2019 -0500
Commit:     Ashod Nakashian <ashnak...@gmail.com>
CommitDate: Wed Dec 11 22:06:46 2019 +0100

    sfx2: sidebar: notify mobile when the sidebar closes
    
    Change-Id: Idb05346a9ccc8690cad566b74ec86d5fdd3bfb35
    Reviewed-on: https://gerrit.libreoffice.org/84973
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 4a7942b16453..561bc1e18ce5 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1211,7 +1211,21 @@ void SidebarController::RequestCloseDeck()
     if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck.get())
     {
         const vcl::ILibreOfficeKitNotifier* pNotifier = 
mpCurrentDeck->GetLOKNotifier();
-        if (pNotifier)
+        auto pMobileNotifier = SfxViewShell::Current();
+        if (pMobileNotifier && 
comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+        {
+            // Mobile.
+            std::stringstream aStream;
+            boost::property_tree::ptree aTree;
+            aTree.put("id", mpParentWindow->get_id()); // TODO could be 
missing - sort out
+            aTree.put("type", "dockingwindow");
+            aTree.put("text", mpParentWindow->GetText());
+            aTree.put("enabled", false);
+            boost::property_tree::write_json(aStream, aTree);
+            const std::string message = aStream.str();
+            pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
message.c_str());
+        }
+        else if (pNotifier)
             pNotifier->notifyWindow(mpCurrentDeck->GetLOKWindowId(), "close");
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to