sfx2/source/sidebar/SidebarDockingWindow.cxx | 37 +++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-)
New commits: commit 50af967b731495be6645f065fd11b9ad832a654a Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Thu Dec 12 01:38:02 2019 -0500 Commit: Jan Holesovsky <ke...@collabora.com> CommitDate: Thu Dec 12 09:10:48 2019 +0100 sfx2: sidebar: publish created notification on Mobile too Change-Id: I59e5db039a6c1f29cb13e7c77a782659dbfb6894 Reviewed-on: https://gerrit.libreoffice.org/85011 Reviewed-by: Jan Holesovsky <ke...@collabora.com> Tested-by: Jan Holesovsky <ke...@collabora.com> diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index ed9340db5550..cba9e50fb2b4 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -74,28 +74,27 @@ public: pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); } } - else - { - // On desktop use the classic notifications. - const Point pos = Point(m_rSidebarDockingWin.GetOutOffXPixel(), - m_rSidebarDockingWin.GetOutOffYPixel()); - const OString posMessage = pos.toString(); - const OString sizeMessage = m_rSidebarDockingWin.GetSizePixel().toString(); - const std::string message = OString(posMessage + sizeMessage).getStr(); - const vcl::LOKWindowId lokWindowId = m_rSidebarDockingWin.GetLOKWindowId(); + // Notify the sidebar is created, and its LOKWindowId, which + // is needed on both Mobile and Desktop. + const Point pos = Point(m_rSidebarDockingWin.GetOutOffXPixel(), + m_rSidebarDockingWin.GetOutOffYPixel()); + const OString posMessage = pos.toString(); + const OString sizeMessage = m_rSidebarDockingWin.GetSizePixel().toString(); - if (lokWindowId != m_LastLOKWindowId || message != m_LastNotificationMessage) - { - m_LastLOKWindowId = lokWindowId; - m_LastNotificationMessage = message; + const std::string message = OString(posMessage + sizeMessage).getStr(); + const vcl::LOKWindowId lokWindowId = m_rSidebarDockingWin.GetLOKWindowId(); - std::vector<vcl::LOKPayloadItem> aItems; - aItems.emplace_back("type", "deck"); - aItems.emplace_back("position", posMessage); - aItems.emplace_back("size", sizeMessage); - pNotifier->notifyWindow(lokWindowId, "created", aItems); - } + if (lokWindowId != m_LastLOKWindowId || message != m_LastNotificationMessage) + { + m_LastLOKWindowId = lokWindowId; + m_LastNotificationMessage = message; + + std::vector<vcl::LOKPayloadItem> aItems; + aItems.emplace_back("type", "deck"); + aItems.emplace_back("position", posMessage); + aItems.emplace_back("size", sizeMessage); + pNotifier->notifyWindow(lokWindowId, "created", aItems); } } catch (boost::property_tree::json_parser::json_parser_error& rError) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits