vcl/source/window/dialog.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 6451da84ecb2942267a4d0d0bbe3ef45060ef71c
Author:     Ashod Nakashian <[email protected]>
AuthorDate: Wed May 8 08:15:52 2019 -0400
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Jul 25 13:59:48 2019 +0200

    vcl: LOK: emmit size_changed after window creation
    
    This guarantees that the correct size of the window
    is set on the client side. Some windows are created
    with default (and invalid) size and rely on Resize
    to be called right after. This doesn't happen
    with message boxes and they need to get size_changed
    right after the window is fully created and ready.
    
    Change-Id: I8c281a31770de4b37b9de6d333159e5379344dff
    Reviewed-on: https://gerrit.libreoffice.org/76293
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 1b6bb7d1d9aa..76cbe8983af7 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -983,7 +983,8 @@ bool Dialog::ImplStartExecute()
     if (bModal)
         pSVData->maAppData.mnModalMode++;
 
-    css::uno::Reference<css::frame::XGlobalEventBroadcaster> 
xEventBroadcaster(css::frame::theGlobalEventBroadcaster::get(xContext), 
css::uno::UNO_SET_THROW);
+    css::uno::Reference<css::frame::XGlobalEventBroadcaster> xEventBroadcaster(
+        css::frame::theGlobalEventBroadcaster::get(xContext), 
css::uno::UNO_SET_THROW);
     css::document::DocumentEvent aObject;
     aObject.EventName = "DialogExecute";
     xEventBroadcaster->documentEventOccured(aObject);
@@ -992,6 +993,20 @@ bool Dialog::ImplStartExecute()
     else
         UITestLogger::getInstance().log("ModelessDialogExecuted Id:" + 
get_id());
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+        {
+            // Dialog boxes don't get the Resize call and they
+            // can have invalid size at 'created' message above.
+            // If there is no difference, the client should detect it and 
ignore us,
+            // otherwise, this should make sure that the window has the 
correct size.
+            std::vector<vcl::LOKPayloadItem> aItems;
+            aItems.emplace_back("size", GetSizePixel().toString());
+            pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
+        }
+    }
+
     return true;
 }
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to