diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-18 17:26:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-18 22:11:04 +0200 |
commit | f7ceb1f805b45cbd4b322da2ca4039d56dd430b3 (patch) | |
tree | 8279505f86c8ca3938ef10234431419cdecfb3b3 /vcl | |
parent | a76116c867380836080adc86bc37c2248778825d (diff) |
tdf#133098 cannot truly unparent a vcl widget
once is created it cannot truly get unparented like a gtk one can, so if we
want to "unparent" it, move it to be a child of the hidden DefaultWindow
instead
Change-Id: I25efa497b99471b5b1df55c6e6a2a6890982b781
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94441
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/stacking.cxx | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 28005bce38ae..82b813a819b8 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1107,7 +1107,10 @@ void SalInstanceContainer::move(weld::Widget* pWidget, weld::Container* pNewPare assert(pVclWidget); SalInstanceContainer* pNewVclParent = dynamic_cast<SalInstanceContainer*>(pNewParent); assert(!pNewParent || pNewVclParent); - pVclWidget->getWidget()->SetParent(pNewVclParent ? pNewVclParent->getWidget() : nullptr); + if (pNewVclParent) + pVclWidget->getWidget()->SetParent(pNewVclParent->getWidget()); + else + pVclWidget->getWidget()->SetParentToDefaultWindow(); } void SalInstanceContainer::recursively_unset_default_buttons() diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 08b6cbaa987e..d5b130031de3 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -841,7 +841,7 @@ static SystemWindow *ImplGetLastSystemWindow( vcl::Window *pWin ) void Window::SetParent( vcl::Window* pNewParent ) { - SAL_INFO_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" ); + SAL_WARN_IF( !pNewParent, "vcl", "Window::SetParent(): pParent == NULL" ); SAL_WARN_IF( pNewParent == this, "vcl", "someone tried to reparent a window to itself" ); if( !pNewParent || pNewParent == this ) |