summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-05-08 08:15:52 -0400
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-25 13:59:48 +0200
commit6451da84ecb2942267a4d0d0bbe3ef45060ef71c (patch)
tree58de3a30f04fc068f2f8329b3a687ba3b9ed650e /vcl
parent1d77ea8f3e64af4becff869474dd79c633dd0070 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx17
1 files changed, 16 insertions, 1 deletions
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;
}