forked from LibreOffice/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit fc2394d
tdf#164072 sw annotation: Use menu parent that outlives menu
When opening the popup menu by right-clicking on a Writer
comment and selecting "Delete All Comments", the SwAnnotationWin
(`mrSidebarWin`) gets disposed while the popup menu and its associated
MenuFloatingWindow are still alive. With the menu floating window
being a child of the SwAnnotationWin, that would trigger the
below assert since
commit 6708246
Author: Michael Weghorn <[email protected]>
Date: Thu Dec 5 11:06:48 2024 +0000
tdf#164093 tdf#157001 a11y: Improve menu window disposal
Avoid disposing parent window before its child by not using
the SwAnnotationWin, but its parent as the popup menu
parent.
warn:legacy.osl:64828:64828:vcl/source/window/window.cxx:307: Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed: 18MenuFloatingWindow()
Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed: 18MenuFloatingWindow()
[New Thread 64828.64829]
[New Thread 64828.64830]
[New Thread 64828.64831]
[New Thread 64828.64832]
[New Thread 64828.64833]
[New Thread 64828.64835]
Thread 1 received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
warning: 44 ./nptl/pthread_kill.c: No such file or directory
(rr) bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
LibreOffice#1 0x00007f580ac9de2f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:78
LibreOffice#2 0x00007f580ac49d02 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
LibreOffice#3 0x00007f580ac324f0 in __GI_abort () at ./stdlib/abort.c:79
LibreOffice#4 0x00007f5801fbc2cb in SalAbort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed: 18MenuFloatingWindow()", bDumpCore=true)
at /home/michi/development/git/libreoffice/vcl/source/app/salplug.cxx:403
LibreOffice#5 0x00007f5802087961 in Application::Abort (rErrorText="Window ( N2sw10annotation15SwAnnotationWinE()) with live SystemWindows destroyed: 18MenuFloatingWindow()")
at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:300
LibreOffice#6 0x00007f580188bba8 in vcl::Window::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:308
LibreOffice#7 0x00007f5801902216 in Control::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/ctrl.cxx:61
LibreOffice#8 0x00007f58019552cc in InterimItemWindow::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/vcl/source/control/InterimItemWindow.cxx:54
LibreOffice#9 0x00007f57ca8fb980 in sw::annotation::SwAnnotationWin::dispose (this=0x55711f066550) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/AnnotationWin.cxx:189
LibreOffice#10 0x00007f5801b06ee3 in VclReferenceBase::disposeOnce (this=0x55711f0667e8) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
LibreOffice#11 0x00007f57ca939d52 in VclPtr<sw::annotation::SwAnnotationWin>::disposeAndClear (this=0x5571205dc3e0) at include/vcl/vclptr.hxx:207
LibreOffice#12 0x00007f57ca9260b5 in SwPostItMgr::RemoveItem (this=0x55711a340eb0, pBroadcast=0x55711fe07bb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:529
LibreOffice#13 0x00007f57ca926662 in SwPostItMgr::Notify (this=0x55711a340eb0, rBC=..., rHint=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:595
LibreOffice#14 0x00007f5806551a4c in SfxBroadcaster::Broadcast (this=0x55711fe07bb0, rHint=...) at /home/michi/development/git/libreoffice/svl/source/notify/SfxBroadcaster.cxx:43
LibreOffice#15 0x00007f57ca0e62c9 in SwpHints::DeleteAtPos (this=0x5571215061d0, nPos=0) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/thints.cxx:3440
LibreOffice#16 0x00007f57ca0b31d1 in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwContentIndex (node 9 offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2877
LibreOffice#17 0x00007f57ca0b501d in SwTextNode::EraseText (this=0x55711a2d3070, rIdx=SwPosition (node 9, offset 4), nCount=1, nMode=SwInsertFlags::DEFAULT) at /home/michi/development/git/libreoffice/sw/source/core/txtnode/ndtxt.cxx:2837
LibreOffice#18 0x00007f57ca1494c2 in SwUndoDelete::SaveContent (this=0x557121daf110, pStart=0x7ffcf6391340, pEnd=0x7ffcf6391388, pSttTextNd=0x55711a2d3070, pEndTextNd=0x55711a2d3070)
at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:476
LibreOffice#19 0x00007f57ca147457 in SwUndoDelete::SwUndoDelete (this=0x557121daf110, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, bFullPara=false, bCalledByTableCpy=false)
at /home/michi/development/git/libreoffice/sw/source/core/undo/undel.cxx:264
LibreOffice#20 0x00007f57c97e72e8 in std::make_unique<SwUndoDelete, SwPaM&, SwDeleteFlags const&> (__args=SwPaM = {...}, __args=@0x7ffcf6391214: SwDeleteFlags::ArtificialSelection)
at /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_ptr.h:1077
LibreOffice#21 0x00007f57c97d79a1 in sw::DocumentContentOperationsManager::DeleteRangeImplImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4574
LibreOffice#22 0x00007f57c97bf899 in sw::DocumentContentOperationsManager::DeleteRangeImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4500
LibreOffice#23 0x00007f57c97c2cf9 in sw::DocumentContentOperationsManager::DeleteAndJoinImpl (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:4471
LibreOffice#24 0x00007f57c97bfc2d in (anonymous namespace)::lcl_DoWithBreaks
(rDocumentContentOperations=..., rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection, pFunc=(bool (sw::DocumentContentOperationsManager::*)(class sw::DocumentContentOperationsManager * const, class SwPaM &, enum SwDeleteFlags)) 0x7f57c97c2cb0 <sw::DocumentContentOperationsManager::DeleteAndJoinImpl(SwPaM&, SwDeleteFlags)>) at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:686
LibreOffice#25 0x00007f57c97c1773 in sw::DocumentContentOperationsManager::DeleteAndJoin (this=0x55711dbb22d0, rPam=SwPaM = {...}, flags=SwDeleteFlags::ArtificialSelection)
at /home/michi/development/git/libreoffice/sw/source/core/doc/DocumentContentOperationsManager.cxx:2377
LibreOffice#26 0x00007f57c9a7ef97 in SwEditShell::DeleteSel (this=0x55711b0054e0, rPam=SwPaM = {...}, isArtificialSelection=true, goLeft=false, pUndo=0x7ffcf6391d9f) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:122
LibreOffice#27 0x00007f57c9a7f538 in SwEditShell::Delete (this=0x55711b0054e0, isArtificialSelection=true, goLeft=false) at /home/michi/development/git/libreoffice/sw/source/core/edit/eddel.cxx:164
LibreOffice#28 0x00007f57cae1c83b in SwWrtShell::DelRight (this=0x55711b0054e0, isReplaceHeuristic=false) at /home/michi/development/git/libreoffice/sw/source/uibase/wrtsh/delete.cxx:419
LibreOffice#29 0x00007f57ca930aaa in SwPostItMgr::Delete (this=0x55711a340eb0) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/PostItMgr.cxx:1770
LibreOffice#30 0x00007f57caa8d050 in SwAnnotationShell::NoteExec (this=0x55711eef12c0, rReq=...) at /home/michi/development/git/libreoffice/sw/source/uibase/shells/annotsh.cxx:1170
LibreOffice#31 0x00007f57caa8cf15 in SfxStubSwAnnotationShellNoteExec (pShell=0x55711eef12c0, rReq=...) at workdir/SdiTarget/sw/sdi/swslots.hxx:19464
LibreOffice#32 0x00007f5806fc9fbe in SfxDispatcher::Call_Impl (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., bRecord=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:255
LibreOffice#33 0x00007f5806fce446 in SfxDispatcher::Execute_ (this=0x55711ae7d3b0, rShell=..., rSlot=..., rReq=..., eCallMode=SfxCallMode::RECORD) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:754
LibreOffice#34 0x00007f5806fb6c8e in SfxBindings::Execute_Impl (this=0x55711de05e80, aReq=..., pSlot=0x7f57caf33a18 <aSwAnnotationShellSlots_Impl+8712>, pShell=0x55711eef12c0)
at /home/michi/development/git/libreoffice/sfx2/source/control/bindings.cxx:1045
LibreOffice#35 0x00007f580709d8bd in SfxDispatchController_Impl::dispatch (this=0x55711e141080, aURL=..., aArgs=empty uno::Sequence, rListener=empty uno::Reference) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:735
LibreOffice#36 0x00007f580709c374 in SfxOfficeDispatch::dispatch (this=0x55711e140fe0, aURL=..., aArgs=empty uno::Sequence) at /home/michi/development/git/libreoffice/sfx2/source/control/unoctitm.cxx:254
LibreOffice#37 0x00007f5808307ddb in framework::MenuBarManager::Select (this=0x55711fe3b8c0, pMenu=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:821
LibreOffice#38 0x00007f580830784d in framework::MenuBarManager::LinkStubSelect (instance=0x55711fe3b8c0, data=0x5571215e12b0) at /home/michi/development/git/libreoffice/framework/source/uielement/menubarmanager.cxx:776
LibreOffice#39 0x00007f58017a64f6 in Link<Menu*, bool>::Call (this=0x5571215e1320, data=0x5571215e12b0) at include/tools/link.hxx:105
LibreOffice#40 0x00007f5801798233 in Menu::Select (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:352
LibreOffice#41 0x00007f58017a56a8 in PopupMenu::ImplFlushPendingSelect (this=0x5571215e12b0) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2872
LibreOffice#42 0x00007f58017a5ced in PopupMenu::FinishRun (this=0x5571215e12b0, pWin=..., pParentWin=..., bRealExecute=true, bIsNativeMenu=true) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3108
LibreOffice#43 0x00007f58017a5487 in PopupMenu::ImplExecute
(this=0x5571215e12b0, pParentWin=..., rRect=..., nPopupModeFlags=(FloatWinPopupFlags::Down | FloatWinPopupFlags::NoKeyClose | FloatWinPopupFlags::AllMouseButtonClose | FloatWinPopupFlags::NewLevel | FloatWinPopupFlags::NoMouseUpClose | FloatWinPopupFlags::GrabFocus), pSFrom=0x0, bPreSelectFirst=false) at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:3033
LibreOffice#44 0x00007f58017a3eca in PopupMenu::Execute (this=0x5571215e12b0, pExecWindow=0x55711f066550, rRect=..., nFlags=(PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose))
at /home/michi/development/git/libreoffice/vcl/source/window/menu.cxx:2860
LibreOffice#45 0x00007f58034b67d3 in VCLXMenu::execute (this=0x5571215df5a0, rxWindowPeer=uno::Reference to (VCLXWindow *) 0x55711ef4bbe8, rPos=..., nFlags=1) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxmenu.cxx:509
LibreOffice#46 0x00007f5806fd2d91 in SfxDispatcher::ExecutePopup (this=0x55711ae7d3b0, rResName="annotation", pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1937
LibreOffice#47 0x00007f5806fd2186 in SfxDispatcher::ExecutePopup (pWin=0x55711f066550, pPos=0x7ffcf6394968) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:1785
LibreOffice#48 0x00007f57ca95d2c3 in sw::sidebarwindows::SidebarTextControl::Command (this=0x5571215354d0, rCEvt=...) at /home/michi/development/git/libreoffice/sw/source/uibase/docvw/SidebarTxtControl.cxx:443
LibreOffice#49 0x00007f5801fb39e1 in weld::CustomWeld::DoCommand (this=0x557121536330, rPos=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:93
#50 0x00007f5801fb371d in weld::CustomWeld::LinkStubDoCommand (instance=0x557121536330, data=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:91
#51 0x00007f57f7799bb6 in Link<CommandEvent const&, bool>::Call (this=0x55711a2c0bd0, data=...) at include/tools/link.hxx:105
#52 0x00007f57f7703ba8 in (anonymous namespace)::GtkInstanceDrawingArea::signal_command (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:19099
#53 0x00007f57f7701f3d in (anonymous namespace)::GtkInstanceDrawingArea::signal_popup_menu (this=0x55711a2c0900, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:18731
#54 0x00007f57f76e3cc7 in (anonymous namespace)::GtkInstanceWidget::signalPopupMenu (pWidget=0x55712152de30, widget=0x55711a2c0900) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:2701
#55 0x00007f57f6c9adb5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#56 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#57 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#58 0x00007f5805548440 in g_signal_emitv () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#59 0x00007f57f6cce9f5 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#60 0x00007f57f6cceff0 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#61 0x00007f57f6cd04bb in gtk_bindings_activate_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#62 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#63 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#64 0x00007f5805541360 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#65 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#66 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#67 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#68 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#69 0x00007f57f6f78143 in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#70 0x00007f57f6f7c9fb in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#71 0x00007f57f77fc4ac in key_forward (pEvent=0x55711a45b0c0, pDest=0x55711ae7bae0) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4239
#72 0x00007f57f77f2f8d in GtkSalFrame::signalKey (pWidget=0x55711ae7bae0, pEvent=0x55711a45b0c0, frame=0x55711af84100) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkframe.cxx:4300
#73 0x00007f57f6c97caa in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#74 0x00007f580552c9c0 in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#75 0x00007f5805540d83 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#76 0x00007f5805542072 in ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#77 0x00007f5805548666 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#78 0x00007f5805548723 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#79 0x00007f57f6f551cc in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#80 0x00007f57f6e05e6f in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#81 0x00007f57f6e07b76 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#82 0x00007f57f7da7ce9 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#83 0x00007f57f7ddc096 in ??? () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#84 0x00007f57fd10b81f in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#85 0x00007f57fd10da57 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#86 0x00007f57fd10e1c0 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#87 0x00007f57f768350c in GtkSalData::Yield (this=0x55711906f850, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkdata.cxx:405
#88 0x00007f57f7688413 in GtkInstance::DoYield (this=0x55711906f700, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:439
#89 0x00007f5802088706 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:385
#90 0x00007f580208801f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:488
#91 0x00007f5802087e00 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:360
#92 0x00007f580af287f9 in desktop::Desktop::Main (this=0x7ffcf6397a70) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1679
#93 0x00007f58020a9b86 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
#94 0x00007f58020ab779 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
#95 0x00007f580afa20da in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
#96 0x00005570fb1c4a6d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
#97 0x00005570fb1c4a47 in main (argc=2, argv=0x7ffcf6397c78) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49
Change-Id: I20d037038c0d4a84d104bf9987bae28835dac609
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181110
Reviewed-by: Michael Weghorn <[email protected]>
Reviewed-by: Noel Grandin <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 0467f88)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181134
Reviewed-by: Adolfo Jayme Barrientos <[email protected]>1 parent 9fcf211 commit fc2394dCopy full SHA for fc2394d
File tree
Expand file treeCollapse file tree
1 file changed
+7
-1
lines changedOpen diff view settings
Filter options
- sw/source/uibase/docvw
Expand file treeCollapse file tree
1 file changed
+7
-1
lines changedOpen diff view settings
Collapse file
sw/source/uibase/docvw/SidebarTxtControl.cxx
Copy file name to clipboardExpand all lines: sw/source/uibase/docvw/SidebarTxtControl.cxx+7-1Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
444 | 450 | | |
445 | 451 | | |
446 | 452 | | |
| |||
0 commit comments