[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Tue Sep 3 11:42:37 UTC 2019


 vcl/source/window/dialog.cxx |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

New commits:
commit 19329f086f09f1dc4db589f12d73a4daae728269
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed May 8 08:15:52 2019 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Sep 3 13:41:48 2019 +0200

    vcl: LOK: emit 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.
    
    (cherry picked from commit abd504c70b7b36b20082677a1b1eef6ff937a6f7)
    
    Change-Id: I8c281a31770de4b37b9de6d333159e5379344dff
    Reviewed-on: https://gerrit.libreoffice.org/77508
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index afc975412186..314d135d973b 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -894,7 +894,7 @@ bool Dialog::ImplStartExecute()
 
     if (bKitActive)
     {
-        if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+        if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
         {
             std::vector<vcl::LOKPayloadItem> aItems;
             aItems.emplace_back("type", "dialog");
@@ -954,7 +954,8 @@ bool Dialog::ImplStartExecute()
     if (bModal)
         pSVData->maAppData.mnModalMode++;
 
-    css::uno::Reference<css::frame::XGlobalEventBroadcaster> xEventBroadcaster(css::frame::theGlobalEventBroadcaster::get(xContext), css::uno::UNO_QUERY_THROW);
+    css::uno::Reference<css::frame::XGlobalEventBroadcaster> xEventBroadcaster(
+        css::frame::theGlobalEventBroadcaster::get(xContext), css::uno::UNO_QUERY_THROW);
     css::document::DocumentEvent aObject;
     aObject.EventName = "DialogExecute";
     xEventBroadcaster->documentEventOccured(aObject);
@@ -963,6 +964,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;
 }
 


More information about the Libreoffice-commits mailing list