From 42fae43d70d3d1b8fcc9fc6328b1060d6d72abfc Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Thu, 7 Dec 2017 21:55:28 +0530 Subject: lokdialog: Open floating window on InitShow only Okay, my bad. InitShow happens after Visible. And InitShow also does some layouting. Emitting the created callback on InitShow means sending more accurate sizes, etc. The different in sizes is 0 for combo boxes, but significant for custom controls like color picker, etc. So emit created callback on InitShow to keep custom controls working. Change-Id: I40b6a18b917dff0eebcfd4c273f3399f3bdc7456 --- vcl/source/window/floatwin.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index d6890e4823cc..d533f558ec6b 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -604,9 +604,9 @@ void FloatingWindow::StateChanged( StateChangedType nType ) SystemWindow::StateChanged( nType ); VclPtr pParent = GetParentWithLOKNotifier(); - if (pParent && nType == StateChangedType::Visible) + if (pParent) { - if (IsVisible()) + if (nType == StateChangedType::InitShow) { std::vector aItems; if (pParent == this) @@ -626,7 +626,7 @@ void FloatingWindow::StateChanged( StateChangedType nType ) aItems.emplace_back(std::make_pair("position", mpImplData->maPos.toString())); GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", aItems); } - else if (!IsVisible()) + else if (!IsVisible() && nType == StateChangedType::Visible) { assert(GetLOKNotifier()); GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "close"); -- cgit