vcl/source/app/salvtables.cxx  |    5 ++++-
 vcl/source/window/stacking.cxx |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit f7ceb1f805b45cbd4b322da2ca4039d56dd430b3
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon May 18 17:26:09 2020 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon May 18 22:11:04 2020 +0200

    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 <[email protected]>

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 )
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to