sfx2/source/dialog/tabdlg.cxx |    4 ++--
 vcl/qt5/QtInstanceBuilder.cxx |    1 +
 vcl/qt5/QtInstanceWidget.cxx  |   30 ++++++++++++------------------
 3 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit 359e9d51217287bae31b5ce6585fce0179f0c6d4
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 10:09:36 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 31 18:49:29 2025 +0200

    tdf#130857 sfx2: Store tab page data before adding to weld::Notebook
    
    Call SfxTabDialogController::AddTabPage to add the
    data of the new tab to `m_pImpl->aData` before
    adding the page to the weld::Notebook widget.
    
    For the case of qt6 with SAL_VCL_QT_USE_WELDED_WIDGETS=1,
    this fixes an assert seen in a WIP branch to support
    the chart "Data Series" dialog because inserting the first
    tab page implicitly activates it, but the signal
    handler expects the tab data to be set already
    when it gets called.
    
    (The GTK and VCL implementations currently suppress more
    signals, which the Qt implementation might also consider
    at some stage in the future, but I can see no reason not
    to switch the order here.)
    
    Backtrace of how the assert would be triggered without
    this commit in place:
    
        1 __pthread_kill_implementation pthread_kill.c 44 0x7f78a269e95c
        2 __pthread_kill_internal pthread_kill.c 89 0x7f78a269e9ff
        3 __GI_raise raise.c 26 0x7f78a2649cc2
        4 __GI_abort abort.c 73 0x7f78a26324ac
        5 __assert_fail_base assert.c 118 0x7f78a2632420
        6 SfxTabDialogController::ActivatePage tabdlg.cxx 533 0x7f789ebcd4e6
        7 SfxTabDialogController::ActivatePageHdl tabdlg.cxx 521 0x7f789ebcd441
        8 SfxTabDialogController::LinkStubActivatePageHdl tabdlg.cxx 519 
0x7f789ebcbcfd
        9 Link<rtl::OUString const&, void>::Call link.hxx 105 0x7f78910a7611
        10 QtInstanceNotebook::currentTabChanged QtInstanceNotebook.cxx 194 
0x7f78910ad194
        11 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, 
QtPrivate::List<>, void, void (QtInstanceNotebook:: *)()>::call(void 
(QtInstanceNotebook:: *)(), QtInstanceNotebook *, void * 
*)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7f78910b36d1
        12 QtPrivate::FunctorCallBase::call_internal<void, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceNotebook:: *)()>::call(void (QtInstanceNotebook:: *)(), 
QtInstanceNotebook *, void * *)::{lambda()#1}>(void * *, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceNotebook:: *)()>::call(void (QtInstanceNotebook:: *)(), 
QtInstanceNotebook *, void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 
0x7f78910b3609
        13 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, 
QtPrivate::List<>, void, void (QtInstanceNotebook:: *)()>::call(void 
(QtInstanceNotebook:: *)(), QtInstanceNotebook *, void * *) qobjectdefs_impl.h 
126 0x7f78910b353b
        14 QtPrivate::FunctionPointer<void (QtInstanceNotebook:: 
*)()>::call<QtPrivate::List<>, void>(void (QtInstanceNotebook:: *)(), 
QtInstanceNotebook *, void * *) qobjectdefs_impl.h 174 0x7f78910b34bd
        15 QtPrivate::QCallableObject<void (QtInstanceNotebook:: *)(), 
QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, 
void * *, bool *) qobjectdefs_impl.h 545 0x7f78910b33e6
        16 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 
0x7f788ff07b32
        17 doActivate<false> qobject.cpp 4283 0x7f789012d33f
        18 QMetaObject::activate qobject.cpp 4343 0x7f78901234a3
        19 QMetaObject::activate<void, int> qobjectdefs.h 319 0x7f788dfdb43b
        20 QTabWidget::currentChanged moc_qtabwidget.cpp 263 0x7f788e4308c8
        21 QTabWidgetPrivate::showTab qtabwidget.cpp 760 0x7f788e43069b
        22 QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, 
QtPrivate::List<int>, void, void (QTabWidgetPrivate:: *)(int)>::call(void 
(QTabWidgetPrivate:: *)(int), QTabWidgetPrivate *, void * 
*)::{lambda()#1}::operator()() const qobjectdefs_impl.h 127 0x7f788e433bda
        23 QtPrivate::FunctorCallBase::call_internal<void, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, 
QtPrivate::List<int>, void, void (QTabWidgetPrivate:: *)(int)>::call(void 
(QTabWidgetPrivate:: *)(int), QTabWidgetPrivate *, void * 
*)::{lambda()#1}>(void * *, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, 
QtPrivate::List<int>, void, void (QTabWidgetPrivate:: *)(int)>::call(void 
(QTabWidgetPrivate:: *)(int), QTabWidgetPrivate *, void * *)::{lambda()#1}&&) 
qobjectdefs_impl.h 65 0x7f788e433a4d
        24 QtPrivate::FunctorCall<std::integer_sequence<unsigned long, 0ul>, 
QtPrivate::List<int>, void, void (QTabWidgetPrivate:: *)(int)>::call 
qobjectdefs_impl.h 126 0x7f788e4339d7
        25 QtPrivate::FunctionPointer<void (QTabWidgetPrivate:: 
*)(int)>::call<QtPrivate::List<int>, void> qobjectdefs_impl.h 174 0x7f788e433941
        26 QtPrivate::QPrivateSlotObject<void (QTabWidgetPrivate:: *)(int), 
QtPrivate::List<int>, void>::impl qobject_p.h 272 0x7f788e433870
        27 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 
0x7f788ff07b32
        28 doActivate<false> qobject.cpp 4283 0x7f789012d33f
        29 QMetaObject::activate qobject.cpp 4343 0x7f78901234a3
        30 QMetaObject::activate<void, int> qobjectdefs.h 319 0x7f788dfdb43b
        31 QTabBar::currentChanged moc_qtabbar.cpp 269 0x7f788e3f6ff8
        32 QTabBar::setCurrentIndex qtabbar.cpp 1441 0x7f788e3f651f
        33 QTabBar::insertTab qtabbar.cpp 970 0x7f788e3f5ed9
        34 QTabWidget::insertTab qtabwidget.cpp 441 0x7f788e42fbb5
        35 QTabWidget::insertTab qtabwidget.cpp 419 0x7f788e42fad3
        36 QtInstanceNotebook::insert_page(rtl::OUString const&, rtl::OUString 
const&, int, rtl::OUString const *)::$_0::operator()() const 
QtInstanceNotebook.cxx 115 0x7f78910b0cf4
        37 std::__invoke_impl<void, 
QtInstanceNotebook::insert_page(rtl::OUString const&, rtl::OUString const&, 
int, rtl::OUString const *)::$_0&>(std::__invoke_other, 
QtInstanceNotebook::insert_page(rtl::OUString const&, rtl::OUString const&, 
int, rtl::OUString const *)::$_0&) invoke.h 61 0x7f78910b0b65
        38 std::__invoke_r<void, QtInstanceNotebook::insert_page(rtl::OUString 
const&, rtl::OUString const&, int, rtl::OUString const 
*)::$_0&>(QtInstanceNotebook::insert_page(rtl::OUString const&, rtl::OUString 
const&, int, rtl::OUString const *)::$_0&) invoke.h 111 0x7f78910b0b25
        39 std::_Function_handler<void(), 
QtInstanceNotebook::insert_page(rtl::OUString const&, rtl::OUString const&, 
int, rtl::OUString const *)::$_0>::_M_invoke std_function.h 290 0x7f78910b09fd
        40 std::function<void()>::operator() std_function.h 591 0x7f78910132ee
        41 QtInstance::RunInMainThread QtInstance.cxx 205 0x7f789100a48f
        42 QtInstanceNotebook::insert_page QtInstanceNotebook.cxx 111 
0x7f78910ae46f
        43 weld::Notebook::append_page weld.hxx 533 0x7f789ebd70c3
        44 SfxTabDialogController::AddTabPage tabdlg.cxx 887 0x7f789ebcfb1a
        45 SfxTabDialogController::AddTabPage tabdlg.cxx 896 0x7f789ebcfb75
        46 chart::SchAttribTabDlg::SchAttribTabDlg dlg_ObjectProperties.cxx 388 
0x7f785e3eb35b
        47 std::_Construct<chart::SchAttribTabDlg, weld::Window *, SfxItemSet 
*, chart::ObjectPropertiesDialogParameter&, chart::ViewElementListProvider *, 
rtl::Reference<chart::ChartModel>&> stl_construct.h 119 0x7f785e4f630f
        48 
std::allocator_traits<std::allocator<void>>::construct<chart::SchAttribTabDlg, 
weld::Window *, SfxItemSet *, chart::ObjectPropertiesDialogParameter&, 
chart::ViewElementListProvider *, rtl::Reference<chart::ChartModel>&> 
alloc_traits.h 706 0x7f785e4f620a
        49 std::_Sp_counted_ptr_inplace<chart::SchAttribTabDlg, 
std::allocator<void>, 
(__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<weld::Window *, SfxItemSet 
*, chart::ObjectPropertiesDialogParameter&, chart::ViewElementListProvider *, 
rtl::Reference<chart::ChartModel>&> shared_ptr_base.h 607 0x7f785e4f620a
        50 
std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<chart::SchAttribTabDlg,
 std::allocator<void>, weld::Window *, SfxItemSet *, 
chart::ObjectPropertiesDialogParameter&, chart::ViewElementListProvider *, 
rtl::Reference<chart::ChartModel>&> shared_ptr_base.h 970 0x7f785e4f608f
        51 std::__shared_ptr<chart::SchAttribTabDlg, 
(__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<void>, weld::Window *, 
SfxItemSet *, chart::ObjectPropertiesDialogParameter&, 
chart::ViewElementListProvider *, rtl::Reference<chart::ChartModel>&> 
shared_ptr_base.h 1713 0x7f785e4f5fb6
        52 
std::shared_ptr<chart::SchAttribTabDlg>::shared_ptr<std::allocator<void>, 
weld::Window *, SfxItemSet *, chart::ObjectPropertiesDialogParameter&, 
chart::ViewElementListProvider *, rtl::Reference<chart::ChartModel>&> 
shared_ptr.h 463 0x7f785e4f5f20
        53 std::make_shared<chart::SchAttribTabDlg, weld::Window *, SfxItemSet 
*, chart::ObjectPropertiesDialogParameter&, chart::ViewElementListProvider *, 
rtl::Reference<chart::ChartModel>&> shared_ptr.h 1007 0x7f785e4f566f
        54 chart::ChartController::executeDlg_ObjectProperties_withUndoGuard 
ChartController_Properties.cxx 749 0x7f785e4f1e5d
        55 chart::ChartController::executeDlg_ObjectProperties 
ChartController_Properties.cxx 696 0x7f785e4f166c
        56 chart::ChartController::executeDispatch_ObjectProperties 
ChartController_Properties.cxx 657 0x7f785e4f176c
        57 chart::ChartController::execute_DoubleClick 
ChartController_Window.cxx 919 0x7f785e512e4e
        58 chart::ChartController::execute_MouseButtonUp 
ChartController_Window.cxx 871 0x7f785e5123f4
        59 chart::ChartWindow::MouseButtonUp ChartWindow.cxx 130 0x7f785e5439c0
        60 ImplHandleMouseEvent winproc.cxx 746 0x7f789928b4ef
        61 ImplHandleSalMouseButtonUp winproc.cxx 2378 0x7f789928fad1
        62 ImplWindowFrameProc winproc.cxx 2727 0x7f789928e7e5
        63 SalFrame::CallCallback salframe.hxx 310 0x7f7890feb5ac
        64 QtFrame::CallCallback QtFrame.hxx 234 0x7f7890fe87c5
        65 QtWidget::handleMouseButtonEvent QtWidget.cxx 112 0x7f789113a76a
        66 QtWidget::mouseReleaseEvent QtWidget.cxx 123 0x7f789113aa0d
        67 QWidget::event qwidget.cpp 9013 0x7f788e0a6d0d
        68 QtWidget::event QtWidget.cxx 504 0x7f789113c4ca
        69 QApplicationPrivate::notify_helper qapplication.cpp 3307 
0x7f788dfe60f0
        70 QApplication::notify qapplication.cpp 2784 0x7f788dfe7db2
        71 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1109 
0x7f7890052a99
        72 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1563 
0x7f7890053799
        73 QApplicationPrivate::sendMouseEvent qapplication.cpp 2365 
0x7f788dfe6a13
        74 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 683 0x7f788e0e6e6f
        75 QWidgetWindow::event qwidgetwindow.cpp 292 0x7f788e0e54a3
        76 QApplicationPrivate::notify_helper qapplication.cpp 3307 
0x7f788dfe60f0
        77 QApplication::notify qapplication.cpp 3257 0x7f788dfe9ff8
        78 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1109 
0x7f7890052a99
        79 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1563 
0x7f7890053799
        80 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2470 
0x7f788ee943f7
        81 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 
2194 0x7f788ee93546
        82 QWindowSystemInterface::sendWindowSystemEvents 
qwindowsysteminterface.cpp 1113 0x7f788ef7c52d
        83 QWindowSystemInterface::flushWindowSystemEvents 
qwindowsysteminterface.cpp 1082 0x7f788ef7c3de
        84 QtWaylandClient::QWaylandDisplay::flushRequests qwaylanddisplay.cpp 
523 0x7f7889eb5665
        85 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, 
QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: 
*)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), 
QtWaylandClient::QWaylandDisplay *, void * *)::{lambda()#1}::operator()() const 
qobjectdefs_impl.h 127 0x7f7889ed1975
        86 QtPrivate::FunctorCallBase::call_internal<void, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void 
(QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, 
void * *)::{lambda()#1}>(void * *, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void 
(QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, 
void * *)::{lambda()#1}&&) qobjectdefs_impl.h 65 0x7f7889ed189d
        87 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, 
QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: 
*)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), 
QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 126 
0x7f7889ed17bf
        88 QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay:: 
*)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay:: 
*)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 174 
0x7f7889ed1731
        89 QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay:: 
*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject 
*, void * *, bool *) qobjectdefs_impl.h 545 0x7f7889ed165b
        90 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 
0x7f788ff07b32
        91 QMetaCallEvent::placeMetaCall qobject.cpp 544 0x7f789011737c
        92 QObject::event qobject.cpp 1464 0x7f7890119501
        93 QApplicationPrivate::notify_helper qapplication.cpp 3307 
0x7f788dfe60f0
        94 QApplication::notify qapplication.cpp 3257 0x7f788dfe9ff8
        95 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1109 
0x7f7890052a99
        96 QCoreApplication::sendEvent qcoreapplication.cpp 1549 0x7f7890053709
        97 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1904 
0x7f789005463a
        98 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1757 
0x7f789005354c
        99 postEventSourceDispatch qeventdispatcher_glib.cpp 246 0x7f789065a4c1
        100 ?? 0x7f7894d043c5
        101 ?? 0x7f7894d065f7
        102 g_main_context_iteration 0x7f7894d06d60
        103 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 399 
0x7f78906596fb
        104 QPAEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 89 
0x7f788f79ba38
        105 QtInstance::ImplYield QtInstance.cxx 501 0x7f7891009cf2
        106 QtInstance::DoYield QtInstance.cxx 512 0x7f789100d031
        107 ImplYield svapp.cxx 385 0x7f7899a5e966
        108 Application::Yield svapp.cxx 488 0x7f7899a5e27f
        109 Application::Execute svapp.cxx 360 0x7f7899a5e060
        110 desktop::Desktop::Main app.cxx 1678 0x7f78a29290b5
        111 ImplSVMain svmain.cxx 230 0x7f7899a8a886
        112 SVMain svmain.cxx 248 0x7f7899a8c379
        113 soffice_main sofficemain.cxx 122 0x7f78a29a2d6a
        114 sal_main main.c 51 0x55edb8b7d9fd
        115 main main.c 49 0x55edb8b7d9d7
    
    Change-Id: I0de53c1c877e73af66bd7bd38573a18d391b62d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188597
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index a93d32016298..93383eadadd2 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -884,8 +884,8 @@ void SfxTabDialogController::AddTabPage(const OUString 
&rName, /* Page ID */
                                         const OUString* pIconName)
 {
     assert(!m_xTabCtrl->get_page(rName) && "Double Page-Ids in the Tabpage");
-    m_xTabCtrl->append_page(rName, rRiderText, pIconName);
     AddTabPage(rName, pCreateFunc, nullptr);
+    m_xTabCtrl->append_page(rName, rRiderText, pIconName);
 }
 
 void SfxTabDialogController::AddTabPage(const OUString &rName,
@@ -901,8 +901,8 @@ void SfxTabDialogController::AddTabPage(const OUString 
&rName, const OUString& r
                                         const OUString* pIconName)
 {
     assert(!m_xTabCtrl->get_page(rName) && "Double Page-Ids in the Tabpage");
-    m_xTabCtrl->append_page(rName, rRiderText, pIconName);
     AddTabPage(rName, nPageCreateId);
+    m_xTabCtrl->append_page(rName, rRiderText, pIconName);
 }
 
 void SfxTabDialogController::AddTabPage(const OUString &rName, const OUString& 
rRiderText,
commit ecf1771334b7c146eb5eb6e2aede2c344fec2e09
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 09:36:36 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 31 18:49:23 2025 +0200

    tdf#130857 qt weld: Improve QtInstanceWidget::{is,get}_visible
    
    QWidget::isVisible only returns true when the widget
    is actually visible on screen, i.e. itself and all
    widgets up to the top-level are marked visible, which matches
    the weld::Widget::is_visible/gtk_widget_is_visible [1]
    semantics, so use it to implement that.
    
    For QtInstanceWidget::get_visible/gtk_widget_get_visible [2],
    the question is whether only the widget itself is marked
    visible, i.e. it would be shown on screen when all parents
    up to the toplevel were marked visible as well.
    
    Reimplement that to return whether all are already visible
    or QWidget::isVisibleTo returns true when called with
    the parent as a param. Quoting the doc [3]:
    
    > Returns true if this widget would become visible if ancestor is shown;
    > otherwise returns false.
    >
    > The true case occurs if neither the widget itself nor any parent up to
    > but excluding ancestor has been explicitly hidden.
    
    Without this commit in place, the "Settings" frame
    in the chart "Data Series" dialog would not be shown
    in a WIP branch declaring support for that dialog
    due to the following logic as the `get_visible()`
    implementations for `m_xMTGap` and `m_xMTOverlap`
    returned false as long as the dialog wasn't shown
    in SchOptionTabPage::AdaptControlPositionsAndVisibility:
    
        void SchOptionTabPage::AdaptControlPositionsAndVisibility()
        {
            m_xGrpAxis->set_visible(m_bProvidesSecondaryYAxis);
            m_xGrpBar->set_visible(m_bProvidesOverlapAndGapWidth);
            m_xCBConnect->set_visible(m_bProvidesBarConnectors);
    
            if (!m_xMTGap->get_visible() && !m_xMTOverlap->get_visible())
                m_xGrpBar->hide();
        }
    
    To trigger the dialog:
    
    * start Writer
    * press the "Insert Chart" toolbar button to insert a chart
    * double-click on one of the bars in the chart
    
    [1] https://docs.gtk.org/gtk3/method.Widget.is_visible.html
    [2] https://docs.gtk.org/gtk3/method.Widget.get_visible.html
    
    Change-Id: I03584fe96b62bb0d58bd27f7a4f49e4c0266ca1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188596
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx
index a263c5eadcb6..d2530a42b0c4 100644
--- a/vcl/qt5/QtInstanceWidget.cxx
+++ b/vcl/qt5/QtInstanceWidget.cxx
@@ -67,31 +67,25 @@ bool QtInstanceWidget::get_sensitive() const
 bool QtInstanceWidget::get_visible() const
 {
     SolarMutexGuard g;
-    QtInstance& rQtInstance = GetQtInstance();
-    if (!rQtInstance.IsMainThread())
-    {
-        bool bVisible = false;
-        rQtInstance.RunInMainThread([&] { bVisible = get_visible(); });
-        return bVisible;
-    }
 
-    return getQWidget()->isVisible();
+    bool bVisible = false;
+    GetQtInstance().RunInMainThread([this, &bVisible] {
+        QWidget* pWidget = getQWidget();
+        bVisible = pWidget->isVisible()
+                   || (!pWidget->isWindow() && 
pWidget->isVisibleTo(pWidget->parentWidget()));
+    });
+
+    return bVisible;
 }
 
 bool QtInstanceWidget::is_visible() const
 {
     SolarMutexGuard g;
-    QtInstance& rQtInstance = GetQtInstance();
-    if (!rQtInstance.IsMainThread())
-    {
-        bool bVisible = false;
-        rQtInstance.RunInMainThread([&] { bVisible = is_visible(); });
-        return bVisible;
-    }
 
-    QWidget* pTopLevel = getQWidget()->topLevelWidget();
-    assert(pTopLevel);
-    return getQWidget()->isVisibleTo(pTopLevel) && pTopLevel->isVisible();
+    bool bVisible = false;
+    GetQtInstance().RunInMainThread([this, &bVisible] { bVisible = 
getQWidget()->isVisible(); });
+
+    return bVisible;
 }
 
 void QtInstanceWidget::set_can_focus(bool bCanFocus)
commit 231b5d61d63dfb26b2a06dc77a134d253f96b575
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 08:42:38 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 31 18:49:17 2025 +0200

    tdf#130857 qt weld: Support doc recovery interrupted dialog
    
    This means that native Qt widgets are used for that dialog
    now when using the qt5 or qt6 VCL plugin and starting LO with
    environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set.
    
    This dialog can be triggered as follows:
    
    * Add an assert to cause LO to "crash" when the "Go to page"
      dialog is opened
    
        --- a/svx/source/dialog/gotodlg.cxx
        +++ b/svx/source/dialog/gotodlg.cxx
        @@ -30,6 +30,7 @@ GotoPageDlg::GotoPageDlg(weld::Window* pParent, const 
OUString& title, const OUS
             , mxPageNumberLbl(m_xBuilder->weld_label(u"page_count"_ustr))
             , mxPageLbl(m_xBuilder->weld_label(u"page_label"_ustr))
         {
        +    assert(false);
             set_title(title);
             mxPageLbl->set_label(label);
    
    * start LO Writer, save the doc
    * Press Ctrl+G to trigger the assert/crash
    * restart LO using
    
        SAL_USE_VCLPLUGIN=qt6 SAL_VCL_QT_USE_WELDED_WIDGETS=1 
./instdir/program/soffice.bin --writer
    
    * cancel document recovery by pressing the "Discard All"
      button
    
    Change-Id: I4c5c5a0f9735533ce1c14c24db925ca4ec04aa03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188595
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx
index bd1314a70076..e1ea56634e0d 100644
--- a/vcl/qt5/QtInstanceBuilder.cxx
+++ b/vcl/qt5/QtInstanceBuilder.cxx
@@ -170,6 +170,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& 
rUIFile, const weld::W
         u"svt/ui/printersetupdialog.ui"_ustr,
         u"svt/ui/restartdialog.ui"_ustr,
         u"svx/ui/compressgraphicdialog.ui"_ustr,
+        u"svx/ui/docrecoverybrokendialog.ui"_ustr,
         u"svx/ui/docrecoveryrecoverdialog.ui"_ustr,
         u"svx/ui/docrecoverysavedialog.ui"_ustr,
         u"svx/ui/fontworkgallerydialog.ui"_ustr,

Reply via email to