vcl/inc/qt5/QtTransferable.hxx | 2 +- vcl/qt5/QtDragAndDrop.cxx | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-)
New commits: commit 479dd32e10d43c881aad61ffe06e57f3c26c6770 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Sat May 10 13:52:13 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat May 10 17:34:25 2025 +0200 tdf#164380 qt: Ensure at least one MIME type for drag'n'drop Ensure that the QMimeData subclass set for the QDrag used for drag and drop reports at least one supported MIME type. Report a dummy "application/x.libreoffice-internal-drag-and-drop" one if there is no other one. (The string used for the MIME type is of no particular meaning, any value would do.) This prevents the issue seen with qt6 on Wayland that a drag and drop operation is cancelled when no formats/MIME types are reported. The "wl_data_offer" Wayland protocol [1] is probably relevant here: > A wl_data_offer represents a piece of data offered for transfer by > another client (the source client). It is used by the copy-and-paste and > drag-and-drop mechanisms. The offer describes the different mime types > that the data can be converted to and provides the mechanism for > transferring the data directly from the source client. > > (...) > > For objects of version 3 or newer, this request determines the final > result of the drag-and-drop operation. If the end result is that no mime > types were accepted, the drag-and-drop operation will be cancelled and > the corresponding drag source will receive wl_data_source.cancelled. (Further analysis on Qt and Wayland library/protocol level might give more insights, but this is sufficient at least for now.) Example backtrace for how QtWaylandClient::QWaylandDrag::cancel (in Qt's qtwayland module) got called previously when releasing the mouse after dragging a slide to a different position in the Impress slide sorter (on Debian testing in a Plasma Wayland session, kwin-wayland 4:6.3.4-3, Qt self-compiled from git dev): Thread 1 "soffice.bin" hit Breakpoint 1, QtWaylandClient::QWaylandDrag::cancel (this=0x5555555d44d0) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddnd.cpp:49 49 QBasicDrag::cancel(); (gdb) bt #0 QtWaylandClient::QWaylandDrag::cancel (this=0x5555555d44d0) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddnd.cpp:49 #1 0x00007fffe479434b in QBasicDrag::eventFilter (this=0x5555555d44d0, o=0x55555e78fb80, e=0x7fffffff3c70) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qsimpledrag.cpp:109 #2 0x00007fffdf182bb5 in QtWaylandClient::QWaylandDrag::finishDrag (this=0x5555555d44d0) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddnd.cpp:101 #3 0x00007fffdf17752e in QtWaylandClient::QWaylandDataDevice::dragSourceCancelled (this=0x5555555dfb60) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddatadevice.cpp:316 #4 0x00007fffdf179ff5 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDataDevice::*)()>::call(void (QtWaylandClient::QWaylandDataDevice::*)(), QtWaylandClient::QWaylandDataDevice*, void**)::{lambda()#1}::operator()() const (this=0x7fffffff3d70) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:127 #5 0x00007fffdf179f1d in QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDataDevice::*)()>::call(void (QtWaylandClient::QWaylandDataDevice::*)(), QtWaylandClient::QWaylandDataDevice*, void**)::{lambda()#1}>(void**, QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDataDevice::*)()>::call(void (QtWaylandClient::QWaylandDataDevice::*)(), QtWaylandClient::QWaylandDataDevice*, void**)::{lambda()#1}&&) (args=0x7fffffff40a0, fn=...) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:65 #6 0x00007fffdf179e3f in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDataDevice::*)()>::call(void (QtWaylandClient::QWaylandDataDevice::*)(), QtWaylandClient::QWaylandDataDevice*, void**) (f=(void (QtWaylandClient::QWaylandDataDevice::*)(QtWaylandClient::QWaylandDataDevice * const)) 0x7fffdf177500 <QtWaylandClient::QWaylandDataDevice::dragSourceCancelled()>, o=0x5555555dfb60, arg=0x7fffffff40a0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:126 #7 0x00007fffdf179db1 in QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDataDevice::*)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDataDevice::*)(), QtWaylandClient::QWaylandDataDevice*, void**) (f=(void (QtWaylandClient::QWaylandDataDevice::*)(QtWaylandClient::QWaylandDataDevice * const)) 0x7fffdf177500 <QtWaylandClient::QWaylandDataDevice::dragSourceCancelled()>, o=0x5555555dfb60, arg=0x7fffffff40a0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:174 #8 0x00007fffdf179cdb in QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDataDevice::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55555e78e0a0, r=0x5555555dfb60, a=0x7fffffff40a0, ret=0x0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:545 #9 0x00007fffe51061d2 in QtPrivate::QSlotObjectBase::call (this=0x55555e78e0a0, r=0x5555555dfb60, a=0x7fffffff40a0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461 #10 0x00007fffe5329cd4 in doActivate<false> (sender=0x55555782a110, signal_index=3, argv=0x7fffffff40a0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4241 #11 0x00007fffe531fec3 in QMetaObject::activate (sender=0x55555782a110, m=0x7fffdf20cb10 <QtWaylandClient::QWaylandDataSource::staticMetaObject>, local_signal_index=0, argv=0x0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4301 #12 0x00007fffdf180206 in QtWaylandClient::QWaylandDataSource::cancelled (this=0x55555782a110) at qtwayland/src/client/WaylandClient_autogen/include/moc_qwaylanddatasource_p.cpp:143 #13 0x00007fffdf1801d9 in QtWaylandClient::QWaylandDataSource::data_source_cancelled (this=0x55555782a110) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddatasource.cpp:41 #14 0x00007fffdf14e06e in QtWayland::wl_data_source::handle_cancelled (data=0x55555782a120, object=0x55555e75d680) at /home/michi/development/git/qt5/qtwayland/src/client/qwayland-wayland.cpp:770 #15 0x00007ffff32986ce in ??? () at /lib/x86_64-linux-gnu/libffi.so.8 #16 0x00007ffff329797e in ??? () at /lib/x86_64-linux-gnu/libffi.so.8 #17 0x00007ffff32981ab in ffi_call () at /lib/x86_64-linux-gnu/libffi.so.8 #18 0x00007fffe6953c91 in ??? () at /lib/x86_64-linux-gnu/libwayland-client.so.0 #19 0x00007fffe694fc1f in ??? () at /lib/x86_64-linux-gnu/libwayland-client.so.0 #20 0x00007fffe6950f13 in wl_display_dispatch_queue_pending () at /lib/x86_64-linux-gnu/libwayland-client.so.0 #21 0x00007fffdf0c2fe2 in QtWaylandClient::EventThread::dispatchQueuePending (this=0x5555555e08c0) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:228 #22 0x00007fffdf0b9604 in QtWaylandClient::EventThread::readAndDispatchEvents (this=0x5555555e08c0) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:113 #23 0x00007fffdf0afd62 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x5555555cd020) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:520 #24 0x00007fffdf0cb1e5 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)::{lambda()#1}::operator()() const (this=0x7fffffff46b0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:127 #25 0x00007fffdf0cb10d in 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}&&) (args=0x7fffd0003c18, fn=...) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:65 #26 0x00007fffdf0cb02f in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**) (f=(void (QtWaylandClient::QWaylandDisplay::*)(QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf0afd30 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555cd020, arg=0x7fffd0003c18) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:126 #27 0x00007fffdf0cafa1 in QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay::*)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**) (f=(void (QtWaylandClient::QWaylandDisplay::*)(QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf0afd30 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555cd020, arg=0x7fffd0003c18) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:174 #28 0x00007fffdf0caecb in QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x5555555f34c0, r=0x5555555cd020, a=0x7fffd0003c18, ret=0x0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:545 #29 0x00007fffe51061d2 in QtPrivate::QSlotObjectBase::call (this=0x5555555f34c0, r=0x5555555cd020, a=0x7fffd0003c18) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461 #30 0x00007fffe53141cc in QMetaCallEvent::placeMetaCall (this=0x7fffd0003bd0, object=0x5555555cd020) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:620 #31 0x00007fffe5315f21 in QObject::event (this=0x5555555cd020, e=0x7fffd0003bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1429 #32 0x00007fffe31e2f30 in QApplicationPrivate::notify_helper (this=0x55555557cb40, receiver=0x5555555cd020, e=0x7fffd0003bd0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3311 #33 0x00007fffe31e6e38 in QApplication::notify (this=0x55555556ea60, receiver=0x5555555cd020, e=0x7fffd0003bd0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3261 #34 0x00007fffe52504f9 in QCoreApplication::notifyInternal2 (receiver=0x5555555cd020, event=0x7fffd0003bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1110 #35 0x00007fffe5251169 in QCoreApplication::sendEvent (receiver=0x5555555cd020, event=0x7fffd0003bd0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1550 #36 0x00007fffe52520a8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555a3f40) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1890 #37 0x00007fffe5250fac in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1744 #38 0x00007fffe5859481 in postEventSourceDispatch (s=0x5555555ca610) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246 #39 0x00007fffe9f04345 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #40 0x00007fffe9f06577 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #41 0x00007fffe9f06ce0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #42 0x00007fffe58586bb in QEventDispatcherGlib::processEvents (this=0x55555556f6e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399 #43 0x00007fffe4989c18 in QPAEventDispatcherGlib::processEvents (this=0x55555556f6e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89 #44 0x00007fffe526a690 in QEventLoop::processEvents (this=0x55555ea18e00, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:104 #45 0x00007fffe526a8e3 in QEventLoop::exec (this=0x55555ea18e00, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:186 #46 0x00007fffe4794d57 in QBasicDrag::drag (this=0x5555555d44d0, o=0x55555e762960) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qsimpledrag.cpp:176 #47 0x00007fffe478a2e8 in QDragManager::drag (this=0x55555e78d700, o=0x55555e762960) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qdnd.cpp:81 #48 0x00007fffe478addb in QDrag::exec (this=0x55555e762960, supportedActions=..., defaultDropAction=Qt::MoveAction) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qdrag.cpp:248 #49 0x00007fffe6192d42 in QtDragSource::startDrag (this=0x555557046c00, sourceActions=3 '', rTrans=uno::Reference to (SdTransferable *) 0x55555a33bda8, rListener=uno::Reference to (SdTransferable *) 0x55555a33bdb8) at vcl/qt6/../qt5/QtDragAndDrop.cxx:54 #50 0x00007fffe6192f10 in non-virtual thunk to QtDragSource::startDrag(com::sun::star::datatransfer::dnd::DragGestureEvent const&, signed char, int, int, com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, com::sun::star::uno::Reference<com::sun::star::datatransfer::dnd::XDragSourceListener> const&) () at vcl/qt6/../qt5/QtDragAndDrop.cxx:76 #51 0x00007fffee725518 in TransferableHelper::StartDrag (this=0x55555a33bd80, pWindow=0x55555a2528e0, nDnDSourceActions=3 '') at /home/michi/development/git/libreoffice/vcl/source/treelist/transfer.cxx:1050 #52 0x00007fff9dbd7ff0 in sd::slidesorter::controller::Clipboard::CreateSlideTransferable (this=0x55555a22d1d0, pWindow=0x55555a2528e0, bDrag=true, bMergeMasterPagesOnly=false) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsClipboard.cxx:499 #53 0x00007fff9dbd9489 in sd::slidesorter::controller::Clipboard::StartDrag (this=0x55555a22d1d0, rPosition=Point = {...}, pWindow=0x55555a2528e0) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsClipboard.cxx:596 #54 0x00007fff9dc1b3ef in sd::slidesorter::SlideSorterViewShell::StartDrag (this=0x55555a21bdc0, rDragPt=Point = {...}, pWindow=0x55555a2528e0) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx:660 #55 0x00007fff9dbf1366 in sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler::DragAndDropModeHandler (this=0x55555e20cd70, rSlideSorter=..., rSelectionFunction=..., rMousePosition=Point = {...}, pWindow=0x55555a2528e0) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:1396 #56 0x00007fff9dbf124d in std::_Construct<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (__p=0x55555e20cd70, __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_construct.h:119 #57 0x00007fff9dbf0e5a in std::allocator_traits<std::allocator<void> >::construct<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (__p=0x55555e20cd70, __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:706 #58 std::_Sp_counted_ptr_inplace<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (this=0x55555e20cd60, __a=..., __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:607 #59 0x00007fff9dbf0c57 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, std::allocator<void>, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (this=0x7fffffff65a0, __p=@0x7fffffff6598: 0x0, __a=..., __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:970 #60 0x00007fff9dbf0b7a in std::__shared_ptr<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<void>, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (this=0x7fffffff6598, __tag=..., __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr_base.h:1713 #61 0x00007fff9dbf0af2 in std::shared_ptr<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler>::shared_ptr<std::allocator<void>, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (this=0x7fffffff6598, __tag=..., __args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:463 #62 0x00007fff9dbee841 in std::make_shared<sd::slidesorter::controller::(anonymous namespace)::DragAndDropModeHandler, sd::slidesorter::SlideSorter&, sd::slidesorter::controller::SelectionFunction&, Point const&, VclPtr<sd::Window>&> (__args=..., __args=..., __args=Point = {...}, __args=...) at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/shared_ptr.h:1007 #63 0x00007fff9dbee754 in sd::slidesorter::controller::SelectionFunction::SwitchToDragAndDropMode (this=0x55555a323350, rMousePosition=Point = {...}) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:661 #64 0x00007fff9dbef8da in sd::slidesorter::controller::SelectionFunction::ModeHandler::StartDrag (this=0x55555ea0d510, rMousePosition=Point = {...}) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:947 #65 0x00007fff9dbf06d4 in sd::slidesorter::controller::(anonymous namespace)::NormalModeHandler::ProcessMotionEvent (this=0x55555ea0d510, rDescriptor=...) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:1102 #66 0x00007fff9dbef62c in sd::slidesorter::controller::SelectionFunction::ModeHandler::ProcessEvent (this=0x55555ea0d510, rDescriptor=...) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:847 #67 0x00007fff9dbee47e in sd::slidesorter::controller::SelectionFunction::ProcessEvent (this=0x55555a323350, rDescriptor=...) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:640 #68 0x00007fff9dbecea8 in sd::slidesorter::controller::SelectionFunction::ProcessMouseEvent (this=0x55555a323350, nEventType=1024, rEvent=...) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:623 #69 0x00007fff9dbecf42 in sd::slidesorter::controller::SelectionFunction::MouseMove (this=0x55555a323350, rEvent=...) at /home/michi/development/git/libreoffice/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx:335 #70 0x00007fff9df19339 in sd::ViewShell::MouseMove (this=0x55555a21bdc0, rMEvt=..., pWin=0x55555a2528e0) at /home/michi/development/git/libreoffice/sd/source/ui/view/viewshel.cxx:700 #71 0x00007fff9df01faa in sd::Window::MouseMove (this=0x55555a2528e0, rMEvt=...) at /home/michi/development/git/libreoffice/sd/source/ui/view/sdwindow.cxx:248 #72 0x00007fffee462270 in ImplHandleMouseEvent (xWindow=..., nSVEvent=NotifyEventType::MOUSEMOVE, bMouseLeave=false, nX=117, nY=328, nMsgTime=16292359, nCode=1, nMode=MouseEventModifiers::DRAGMOVE) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:693 #73 0x00007fffee466675 in ImplHandleSalMouseMove (pWindow=0x555556e035d0, pEvent=0x7fffffff81b8) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2330 #74 0x00007fffee465304 in ImplWindowFrameProc (_pWindow=0x555556e035d0, nEvent=SalEvent::MouseMove, pEvent=0x7fffffff81b8) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2663 #75 0x00007fffe61cbdec in SalFrame::CallCallback (this=0x5555560402d0, nEvent=SalEvent::MouseMove, pEvent=0x7fffffff81b8) at vcl/inc/salframe.hxx:310 #76 0x00007fffe61c8a45 in QtFrame::CallCallback (this=0x5555560402c0, nEvent=SalEvent::MouseMove, pEvent=0x7fffffff81b8) at vcl/inc/qt6/../qt5/QtFrame.hxx:235 #77 0x00007fffe62fb633 in QtWidget::mouseMoveEvent (this=0x555556dfbdb0, pEvent=0x7fffffff9440) at vcl/qt6/../qt5/QtWidget.cxx:135 #78 0x00007fffe32a2ae5 in QWidget::event (this=0x555556dfbdb0, event=0x7fffffff9440) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidget.cpp:8969 #79 0x00007fffe62fd01a in QtWidget::event (this=0x555556dfbdb0, pEvent=0x7fffffff9440) at vcl/qt6/../qt5/QtWidget.cxx:513 #80 0x00007fffe31e2f30 in QApplicationPrivate::notify_helper (this=0x55555557cb40, receiver=0x555556dfbdb0, e=0x7fffffff9440) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3311 #81 0x00007fffe31e4bf2 in QApplication::notify (this=0x55555556ea60, receiver=0x555556dfbdb0, e=0x7fffffff9440) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2788 #82 0x00007fffe52504f9 in QCoreApplication::notifyInternal2 (receiver=0x555556dfbdb0, event=0x7fffffff9440) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1110 #83 0x00007fffe52511f9 in QCoreApplication::sendSpontaneousEvent (receiver=0x555556dfbdb0, event=0x7fffffff9440) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1564 #84 0x00007fffe31e3853 in QApplicationPrivate::sendMouseEvent (receiver=0x555556dfbdb0, event=0x7fffffff9440, alienWidget=0x555556dfbdb0, nativeWidget=0x555556df4450, buttonDown=0x7fffe3dd9488 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:2369 #85 0x00007fffe32e2ad8 in QWidgetWindow::handleMouseEvent (this=0x5555575a7590, event=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:669 #86 0x00007fffe32e12f3 in QWidgetWindow::event (this=0x5555575a7590, event=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qwidgetwindow.cpp:292 #87 0x00007fffe31e2f30 in QApplicationPrivate::notify_helper (this=0x55555557cb40, receiver=0x5555575a7590, e=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3311 #88 0x00007fffe31e6e38 in QApplication::notify (this=0x55555556ea60, receiver=0x5555575a7590, e=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3261 #89 0x00007fffe52504f9 in QCoreApplication::notifyInternal2 (receiver=0x5555575a7590, event=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1110 #90 0x00007fffe52511f9 in QCoreApplication::sendSpontaneousEvent (receiver=0x5555575a7590, event=0x7fffffffa518) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1564 #91 0x00007fffe408eb27 in QGuiApplicationPrivate::processMouseEvent (e=0x55555da09130) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2480 #92 0x00007fffe408dc76 in QGuiApplicationPrivate::processWindowSystemEvent (e=0x55555da09130) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2204 #93 0x00007fffe417628d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1113 #94 0x00007fffe417613e in QWindowSystemInterface::flushWindowSystemEvents (flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1082 #95 0x00007fffdf0afd75 in QtWaylandClient::QWaylandDisplay::flushRequests (this=0x5555555cd020) at /home/michi/development/git/qt5/qtwayland/src/client/qwaylanddisplay.cpp:521 #96 0x00007fffdf0cb1e5 in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**)::{lambda()#1}::operator()() const (this=0x7fffffffaa20) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:127 #97 0x00007fffdf0cb10d in 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}&&) (args=0x7fffd0002f38, fn=...) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:65 #98 0x00007fffdf0cb02f in QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, void, void (QtWaylandClient::QWaylandDisplay::*)()>::call(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**) (f=(void (QtWaylandClient::QWaylandDisplay::*)(QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf0afd30 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555cd020, arg=0x7fffd0002f38) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:126 #99 0x00007fffdf0cafa1 in QtPrivate::FunctionPointer<void (QtWaylandClient::QWaylandDisplay::*)()>::call<QtPrivate::List<>, void>(void (QtWaylandClient::QWaylandDisplay::*)(), QtWaylandClient::QWaylandDisplay*, void**) (f=(void (QtWaylandClient::QWaylandDisplay::*)(QtWaylandClient::QWaylandDisplay * const)) 0x7fffdf0afd30 <QtWaylandClient::QWaylandDisplay::flushRequests()>, o=0x5555555cd020, arg=0x7fffd0002f38) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:174 #100 0x00007fffdf0caecb in QtPrivate::QCallableObject<void (QtWaylandClient::QWaylandDisplay::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x5555555f34c0, r=0x5555555cd020, a=0x7fffd0002f38, ret=0x0) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:545 #101 0x00007fffe51061d2 in QtPrivate::QSlotObjectBase::call (this=0x5555555f34c0, r=0x5555555cd020, a=0x7fffd0002f38) at qtbase/src/corelib/kernel/qobjectdefs_impl.h:461 #102 0x00007fffe53141cc in QMetaCallEvent::placeMetaCall (this=0x7fffd0002ef0, object=0x5555555cd020) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:620 #103 0x00007fffe5315f21 in QObject::event (this=0x5555555cd020, e=0x7fffd0002ef0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:1429 #104 0x00007fffe31e2f30 in QApplicationPrivate::notify_helper (this=0x55555557cb40, receiver=0x5555555cd020, e=0x7fffd0002ef0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3311 #105 0x00007fffe31e6e38 in QApplication::notify (this=0x55555556ea60, receiver=0x5555555cd020, e=0x7fffd0002ef0) at /home/michi/development/git/qt5/qtbase/src/widgets/kernel/qapplication.cpp:3261 #106 0x00007fffe52504f9 in QCoreApplication::notifyInternal2 (receiver=0x5555555cd020, event=0x7fffd0002ef0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1110 #107 0x00007fffe5251169 in QCoreApplication::sendEvent (receiver=0x5555555cd020, event=0x7fffd0002ef0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1550 #108 0x00007fffe52520a8 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555a3f40) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1890 #109 0x00007fffe5250fac in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1744 #110 0x00007fffe5859481 in postEventSourceDispatch (s=0x5555555ca610) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:246 #111 0x00007fffe9f04345 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #112 0x00007fffe9f06577 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #113 0x00007fffe9f06ce0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #114 0x00007fffe58586bb in QEventDispatcherGlib::processEvents (this=0x55555556f6e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:399 #115 0x00007fffe4989c18 in QPAEventDispatcherGlib::processEvents (this=0x55555556f6e0, flags=...) at /home/michi/development/git/qt5/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:89 #116 0x00007fffe61ea842 in QtInstance::ImplYield (this=0x5555555f9020, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:501 #117 0x00007fffe61edb41 in QtInstance::DoYield (this=0x5555555f9020, bWait=true, bHandleAllCurrentEvents=false) at vcl/qt6/../qt5/QtInstance.cxx:512 #118 0x00007fffeec40736 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385 #119 0x00007fffeec4004f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488 #120 0x00007fffeec3fe30 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360 #121 0x00007ffff7b28bb9 in desktop::Desktop::Main (this=0x7fffffffd650) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1680 #122 0x00007fffeec61f76 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:231 #123 0x00007fffeec63ba9 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:249 #124 0x00007ffff7ba306a in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122 #125 0x00005555555559fd in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51 #126 0x00005555555559d7 in main (argc=1, argv=0x7fffffffd858) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49 [1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_offer Change-Id: I41476b2c9330a5a67e7663ac53a5ba57601c4b03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185136 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/inc/qt5/QtTransferable.hxx b/vcl/inc/qt5/QtTransferable.hxx index 466ad633f575..ee9d5e22d4aa 100644 --- a/vcl/inc/qt5/QtTransferable.hxx +++ b/vcl/inc/qt5/QtTransferable.hxx @@ -112,7 +112,7 @@ typedef QtTransferable QtDnDTransferable; * * It's the "mirror" interface of the QtTransferable. **/ -class QtMimeData final : public QMimeData +class QtMimeData : public QMimeData { Q_OBJECT diff --git a/vcl/qt5/QtDragAndDrop.cxx b/vcl/qt5/QtDragAndDrop.cxx index 7673bb5b73e3..61ea40df600a 100644 --- a/vcl/qt5/QtDragAndDrop.cxx +++ b/vcl/qt5/QtDragAndDrop.cxx @@ -23,6 +23,32 @@ using namespace com::sun::star; +namespace +{ +/** QtMimeData subclass that ensures that at least one MIME type is + * reported (using a dummy one if necessary), to prevent drag and drop + * operations on Wayland from getting cancelled (see tdf#164380). + */ +class QtDragMimeData : public QtMimeData +{ +public: + explicit QtDragMimeData(const css::uno::Reference<css::datatransfer::XTransferable>& rContents) + : QtMimeData(rContents) + { + } + + QStringList formats() const override + { + QStringList aFormats = QtMimeData::formats(); + if (!aFormats.empty()) + return aFormats; + + // report a dummy MIME type + return { "application/x.libreoffice-internal-drag-and-drop" }; + } +}; +} + QtDragSource::QtDragSource(QtFrame* pFrame) : WeakComponentImplHelper(m_aMutex) , m_pFrame(pFrame) @@ -48,7 +74,7 @@ void QtDragSource::startDrag( if (m_pFrame) { QDrag* drag = new QDrag(m_pFrame->GetQWidget()); - drag->setMimeData(new QtMimeData(rTrans)); + drag->setMimeData(new QtDragMimeData(rTrans)); // just a reminder that exec starts a nested event loop, so everything after // this call is just executed, after D'n'D has finished! drag->exec(toQtDropActions(sourceActions), getPreferredDropAction(sourceActions));