summaryrefslogtreecommitdiff
path: root/vcl/source/window/floatwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/floatwin.cxx')
-rw-r--r--vcl/source/window/floatwin.cxx39
1 files changed, 22 insertions, 17 deletions
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 6a3385360ed7..ce289a804e50 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -597,10 +597,10 @@ bool FloatingWindow::Notify( NotifyEvent& rNEvt )
void FloatingWindow::LogicInvalidate(const Rectangle* /*pRectangle*/)
{
- Dialog* pParentDlg = GetParentDialog();
- if (pParentDlg)
+ if (vcl::Window* pParent = GetParentWithLOKNotifier())
{
- pParentDlg->InvalidateFloatingWindow(mpImplData->maPos);
+ const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
+ pNotifier->notifyWindow(GetLOKWindowId(), "invalidate");
}
}
@@ -612,14 +612,26 @@ void FloatingWindow::StateChanged( StateChangedType nType )
}
SystemWindow::StateChanged( nType );
- Dialog* pParentDlg = GetParentDialog();
- if (pParentDlg && nType == StateChangedType::InitShow && IsVisible())
- {
- pParentDlg->InvalidateFloatingWindow(mpImplData->maPos);
- }
- else if (pParentDlg && !IsVisible())
+
+ if (vcl::Window* pParent = GetParentWithLOKNotifier())
{
- pParentDlg->CloseFloatingWindow();
+ const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
+ if (nType == StateChangedType::InitShow && IsVisible())
+ {
+ SetLOKNotifier(pNotifier);
+
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back(std::make_pair("type", "child"));
+ aItems.emplace_back(std::make_pair("parentId", OString::number(pParent->GetLOKWindowId())));
+ aItems.emplace_back(std::make_pair("size", GetSizePixel().toString()));
+ aItems.emplace_back(std::make_pair("position", mpImplData->maPos.toString()));
+ pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+ }
+ else if (!IsVisible())
+ {
+ pNotifier->notifyWindow(GetLOKWindowId(), "close");
+ ReleaseLOKNotifier();
+ }
}
if ( nType == StateChangedType::ControlBackground )
@@ -729,13 +741,6 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags
GrabFocus();
}
Show( true, ShowFlags::NoActivate );
-
- if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
- {
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back(std::make_pair("size", rRect.GetSize().toString()));
- pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
- }
}
void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags )