vcl/inc/qt5/QtWidget.hxx | 2 +- vcl/qt5/QtWidget.cxx | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-)
New commits: commit fc1db03eb2ced7524bfcb7b6d2cb46469b347c13 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jan 14 15:36:55 2025 +0100 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Wed Jan 22 13:20:25 2025 +0100 qt: No longer manually destroy QWindow With current qtbase git dev, expanding the Font Name combobox in Writer's Formatting toolbar and clicking on a combobox entry to select it triggers a crash in `QWidgetWindow::handleMouseEvent`, similar to the one described in more detail and fixed in commit 4b547f11ae3e943e67c195a67a033307ce7f1d6d Author: Michael Weghorn <m.wegh...@posteo.de> Date: Tue Dec 24 13:12:18 2024 +0100 tdf#130857 qt weld: Defer QDialog deletion . For the scenario here, the QWidgetWindow whose virtual method gets called (causing the crash) was destroyed with this backtrace earlier: 1 QWidgetWindow::~QWidgetWindow qwidgetwindow.cpp 162 0x7f856b6dc6c7 2 QWidgetWindow::~QWidgetWindow qwidgetwindow.cpp 160 0x7f856b6dc80d 3 QWidgetPrivate::deleteTLSysExtra qwidget.cpp 1711 0x7f856b687fa1 4 QWidget::destroy qwidget.cpp 12612 0x7f856b687bd6 5 QtWidget::hideEvent QtWidget.cxx 261 0x7f856e63decc 6 QWidget::event qwidget.cpp 9199 0x7f856b69fd67 7 QtWidget::event QtWidget.cxx 689 0x7f856e63f6ce 8 QApplicationPrivate::notify_helper qapplication.cpp 3305 0x7f856b5e2dd0 9 QApplication::notify qapplication.cpp 3251 0x7f856b5e6cc9 10 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1118 0x7f856d6481b9 11 QCoreApplication::sendEvent qcoreapplication.cpp 1558 0x7f856d648e29 12 QWidgetPrivate::hide_helper qwidget.cpp 8205 0x7f856b69d95f 13 QWidgetPrivate::setVisible qwidget.cpp 8402 0x7f856b69e9d5 14 QWidget::setVisible qwidget.cpp 8310 0x7f856b69e1dc 15 QtFrame::Show QtFrame.cxx 398 0x7f856e53ec37 16 vcl::Window::Show window.cxx 2218 0x7f85786ccd7f 17 vcl::Window::Show window.cxx 2212 0x7f85786cccaa 18 FloatingWindow::ImplEndPopupMode floatwin.cxx 896 0x7f857858caf1 19 FloatingWindow::EndPopupMode floatwin.cxx 948 0x7f8578589485 20 ComboBox::ImplSelectHdl combobox.cxx 410 0x7f857872ee66 21 ComboBox::LinkStubImplSelectHdl combobox.cxx 316 0x7f857872d2bd 22 Link<LinkParamNone *, void>::Call link.hxx 101 0x7f85784223a1 23 ImplListBoxWindow::ImplCallSelect imp_listbox.cxx 722 0x7f85787c0bc0 24 ImplListBoxWindow::Tracking imp_listbox.cxx 1133 0x7f85787c221f 25 vcl::Window::EndTracking window2.cxx 341 0x7f85786ae763 26 ImplHandleMouseEvent winproc.cxx 713 0x7f85786e8aae 27 ImplHandleSalMouseButtonUp winproc.cxx 2351 0x7f85786ed041 28 ImplWindowFrameProc winproc.cxx 2700 0x7f85786ebd50 29 SalFrame::CallCallback salframe.hxx 311 0x7f856e54cecc 30 QtFrame::CallCallback QtFrame.hxx 235 0x7f856e549e95 31 QtWidget::handleMouseButtonEvent QtWidget.cxx 117 0x7f856e63d45a 32 QtWidget::mouseReleaseEvent QtWidget.cxx 128 0x7f856e63d711 33 QWidget::event qwidget.cpp 8971 0x7f856b69f34d 34 QtWidget::event QtWidget.cxx 689 0x7f856e63f6ce 35 QApplicationPrivate::notify_helper qapplication.cpp 3305 0x7f856b5e2dd0 36 QApplication::notify qapplication.cpp 2782 0x7f856b5e4aa2 37 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1118 0x7f856d6481b9 38 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1572 0x7f856d648eb9 39 QApplicationPrivate::sendMouseEvent qapplication.cpp 2363 0x7f856b5e36f7 40 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 664 0x7f856b6de49b 41 QWidgetWindow::event qwidgetwindow.cpp 292 0x7f856b6dcd25 42 QApplicationPrivate::notify_helper qapplication.cpp 3305 0x7f856b5e2dd0 43 QApplication::notify qapplication.cpp 3255 0x7f856b5e6ced 44 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1118 0x7f856d6481b9 45 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1572 0x7f856d648eb9 46 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2485 0x7f856c484282 47 QGuiApplicationPrivate::processWindowSystemEvent qguiapplication.cpp 2212 0x7f856c483446 48 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 1113 0x7f856c56a27d 49 QWindowSystemInterface::flushWindowSystemEvents qwindowsysteminterface.cpp 1082 0x7f856c56a12e 50 QtWaylandClient::QWaylandDisplay::flushRequests qwaylanddisplay.cpp 524 0x7f8569ca7635 51 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 0x7f8569cc32d5 52 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 0x7f8569cc31fd 53 QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay:: *)()>::call(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 126 0x7f8569cc311f 54 QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay:: *)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay:: *)(), QtWaylandClient::QWaylandDisplay *, void * *) qobjectdefs_impl.h 174 0x7f8569cc3091 55 QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobjectdefs_impl.h 545 0x7f8569cc2fbb 56 QtPrivate::QSlotObjectBase::call qobjectdefs_impl.h 461 0x7f856d65e772 57 QMetaCallEvent::placeMetaCall qobject.cpp 622 0x7f856d707e5c 58 QObject::event qobject.cpp 1431 0x7f856d709bb1 59 QApplicationPrivate::notify_helper qapplication.cpp 3305 0x7f856b5e2dd0 60 QApplication::notify qapplication.cpp 3255 0x7f856b5e6ced 61 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1118 0x7f856d6481b9 62 QCoreApplication::sendEvent qcoreapplication.cpp 1558 0x7f856d648e29 63 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1898 0x7f856d649d68 64 QCoreApplication::sendPostedEvents qcoreapplication.cpp 1752 0x7f856d648c6c 65 postEventSourceDispatch qeventdispatcher_glib.cpp 246 0x7f856dc377b1 66 ?? 0x7f857430b81f 67 ?? 0x7f857430da57 68 g_main_context_iteration 0x7f857430e1c0 69 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 399 0x7f856dc369eb 70 QPAEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 89 0x7f856cd64858 71 QtInstance::ImplYield QtInstance.cxx 464 0x7f856e56a532 72 QtInstance::DoYield QtInstance.cxx 475 0x7f856e56d5b1 73 ImplYield svapp.cxx 385 0x7f8578ebd8d6 74 Application::Yield svapp.cxx 488 0x7f8578ebd1ef 75 Application::Execute svapp.cxx 360 0x7f8578ebcfd0 76 desktop::Desktop::Main app.cxx 1679 0x7f8581d27b89 77 ImplSVMain svmain.cxx 230 0x7f8578eded56 78 SVMain svmain.cxx 248 0x7f8578ee0949 79 soffice_main sofficemain.cxx 121 0x7f8581da146a 80 sal_main main.c 51 0x55d374ac7a6d 81 main main.c 49 0x55d374ac7a47 To fix that, no longer manually destroy the QWindow (s. frame 5). This reverts commit commit 2284e26a0731a606568eda706e8e4451aaf880d8 Author: Michael Weghorn <m.wegh...@posteo.de> Date: Thu Sep 19 09:49:57 2024 +0200 qt a11y: Destroy QWindow when popup gets hidden (which wasn't causing any such issues before qtbase commit [1]) and results in the top-level frame of the combobox popup not getting removed from the a11y layer any more when the combobox gets closed (s. commit message of the above commit for more details), so this will need another solution instead. (Using native QComboBoxes might solve this issue as well, once the Qt welding process - see tdf#130857 - has reached the point where these comboboxes can be native Qt ones.) [1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=84a5f50c7766c99f62b22bb4388137e0aa8dd13d Change-Id: I3dfd7bd7883498a68b3106bf42541c2948344040 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180243 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> (cherry picked from commit 14a221bf5687d368f5918295682de2ccf8a5e814) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180267 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit fcb7c7fc991947b5786e544cb12d0d6b6a5d48eb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180485 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/vcl/inc/qt5/QtWidget.hxx b/vcl/inc/qt5/QtWidget.hxx index 95cd2e9fa494..9284cf401f2d 100644 --- a/vcl/inc/qt5/QtWidget.hxx +++ b/vcl/inc/qt5/QtWidget.hxx @@ -70,7 +70,7 @@ class QtWidget : public QWidget virtual void paintEvent(QPaintEvent*) override; virtual void resizeEvent(QResizeEvent*) override; virtual void showEvent(QShowEvent*) override; - virtual void hideEvent(QHideEvent* pEvent) override; + virtual void hideEvent(QHideEvent*) override; virtual void wheelEvent(QWheelEvent*) override; virtual void closeEvent(QCloseEvent*) override; virtual void changeEvent(QEvent*) override; diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx index 37c5e7fff912..f6a932068ba2 100644 --- a/vcl/qt5/QtWidget.cxx +++ b/vcl/qt5/QtWidget.cxx @@ -245,21 +245,10 @@ void QtWidget::showEvent(QShowEvent*) m_rFrame.CallCallback(SalEvent::Paint, &aPaintEvt); } -void QtWidget::hideEvent(QHideEvent* pEvent) +void QtWidget::hideEvent(QHideEvent*) { - if (m_rFrame.isPopup()) - { - if (GetQtInstance().activePopup() == &m_rFrame) - GetQtInstance().setActivePopup(nullptr); - - // destroy the QWindow as the popup would otherwise still show up - // as a top-level child of the app on the a11y level - // (Qt explicitly filters out widgets of type Qt::Popup, but - // Qt::ToolTip is currently used for popups to work around another - // issue, s. the QtFrame ctor) - if (!pEvent->spontaneous()) - destroy(); - } + if (m_rFrame.isPopup() && GetQtInstance().activePopup() == &m_rFrame) + GetQtInstance().setActivePopup(nullptr); } void QtWidget::closeEvent(QCloseEvent* /*pEvent*/)