framework/source/loadenv/loadenv.cxx |   26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

New commits:
commit f2f7209d5226a34e96d7a308a86b67607d268001
Author:     Michael Weghorn <[email protected]>
AuthorDate: Tue Jan 20 10:10:13 2026 +0100
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Thu Jan 22 09:34:34 2026 +0100

    tdf#170399 Revert LoadEnv changes from "tdf#41777 Add window size ...
    
    ... and position for each document"
    
    The changes to LoadEnv in
    
        commit 8ce2cf3973ecd428eb8d0290930791ee1c771626
        Date:   Mon May 12 01:29:55 2025 +0700
    
            tdf#41777 Add window size and position for each document
    
    to create new frames when loading existing documents from
    the start center and close the backing window cause
    crashes for the tdf#170399 scenario of starting the template manager
    from the start center and then editing a template by selecting
    the "Edit" entry from its context menu.
    
    Revert the changes to that class for now, to fix the crashes.
    
    In a quick test with the gen VCL plugin, this causes documents
    opened from the start center to no longer be restored in the
    position that they were in previously, while opening documents
    directly (i.e. not from start center) still results in them
    getting restored at the previous location. (Tested with two
    different documents that were saved and closed in different
    locations on the screen and both were restored at their
    original location.)
    
    This partially reverts commit 8ce2cf3973ecd428eb8d0290930791ee1c771626.
    
    Backtrace for the gen VCL plugin without this commit in place:
    
        warn:legacy.osl:835647:835647:vcl/source/window/window.cxx:307: Window 
( 14VclDrawingArea()) with live SystemWindows destroyed:  18MenuFloatingWindow()
        Window ( 14VclDrawingArea()) with live SystemWindows destroyed:  
18MenuFloatingWindow()
    
        Thread 1 "soffice.bin" 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
        (gdb) bt
        #0  __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        #1  0x00007ffff769749f in __pthread_kill_internal (threadid=<optimized 
out>, signo=6) at ./nptl/pthread_kill.c:89
        #2  0x00007ffff7640942 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
        #3  0x00007ffff76284ac in __GI_abort () at ./stdlib/abort.c:77
        #4  0x00007fffee2339db in SalAbort (rErrorText="Window ( 
14VclDrawingArea()) with live SystemWindows destroyed:  
18MenuFloatingWindow()", bDumpCore=true) at 
/home/michi/development/git/libreoffice/vcl/source/app/salplug.cxx:403
        #5  0x00007fffee2ff4b1 in Application::Abort (rErrorText="Window ( 
14VclDrawingArea()) with live SystemWindows destroyed:  
18MenuFloatingWindow()") at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:300
        #6  0x00007fffedc25c54 in vcl::Window::dispose (this=0x5555573055d0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:308
        #7  0x00007fffedc9e1c6 in Control::dispose (this=0x5555573055d0) at 
/home/michi/development/git/libreoffice/vcl/source/control/ctrl.cxx:62
        #8  0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x555557305890) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #9  0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffe72d0) at include/vcl/vclptr.hxx:208
        #10 0x00007ffff0069f57 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x555557168d30) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:250
        #11 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557168d30) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #12 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x555557168d80) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #13 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffe8798) at include/vcl/vclptr.hxx:208
        #14 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577d6d80) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #15 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x5555573c4dd0) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #16 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555573c4dd0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #17 0x00007fffedafd800 in VclScrolledWindow::dispose 
(this=0x5555573c4dd0) at 
/home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:1926
        #18 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x5555573c4e48) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #19 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffe9eb8) at include/vcl/vclptr.hxx:208
        #20 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x55555788b020) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #21 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x555557722300) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #22 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557722300) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #23 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x555557722350) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #24 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffeb5b8) at include/vcl/vclptr.hxx:208
        #25 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577a9df0) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #26 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x55555772fe50) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #27 0x00007fffedc24eca in vcl::Window::dispose (this=0x55555772fe50) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #28 0x00007fffedafb566 in VclFrame::dispose (this=0x55555772fe50) at 
/home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:1493
        #29 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x55555772fea8) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #30 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffeccd8) at include/vcl/vclptr.hxx:208
        #31 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c1ac0) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #32 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x5555572db4d0) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #33 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555572db4d0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #34 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x5555572db520) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #35 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffee3d8) at include/vcl/vclptr.hxx:208
        #36 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c5650) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #37 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x5555576ebfe0) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #38 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555576ebfe0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #39 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x5555576ec030) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #40 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7ffffffefad8) at include/vcl/vclptr.hxx:208
        #41 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c8d10) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #42 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x555557806110) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #43 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557806110) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #44 0x00007fffedbc4b04 in SystemWindow::dispose (this=0x555557806110) 
at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:119
        #45 0x00007fffeda8e38c in Dialog::dispose (this=0x555557806110) at 
/home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:632
        #46 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x5555578061f0) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #47 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7fffffff1338) at include/vcl/vclptr.hxx:208
        #48 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x555557897d70) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #49 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x5555578924d0) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
        #50 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555578924d0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #51 0x00007fffed9c1dc4 in ImplBorderWindow::dispose 
(this=0x5555578924d0) at 
/home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:1615
        #52 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x555557892530) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #53 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7fffffff2b68) at include/vcl/vclptr.hxx:208
        #54 0x00007ffff006a6a7 in UnoWrapper::WindowDestroyed 
(this=0x5555568aaf90, pWindow=0x555556ef0dc0) at 
/home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:308
        #55 0x00007fffedc24eca in vcl::Window::dispose (this=0x555556ef0dc0) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
        #56 0x00007fffedbc4b04 in SystemWindow::dispose (this=0x555556ef0dc0) 
at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:119
        #57 0x00007fffedc596c1 in WorkWindow::dispose (this=0x555556ef0dc0) at 
/home/michi/development/git/libreoffice/vcl/source/window/wrkwin.cxx:127
        #58 0x00007fffedea0d53 in VclReferenceBase::disposeOnce 
(this=0x555556ef0e80) at 
/home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
        #59 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear 
(this=0x7fffffff40e8) at include/vcl/vclptr.hxx:208
        #60 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555570cde30) at 
/home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
        #61 0x00007ffff49f5fd9 in (anonymous namespace)::XFrameImpl::disposing 
(this=0x555556dd1610) at 
/home/michi/development/git/libreoffice/framework/source/services/frame.cxx:2184
        #62 0x00007ffff573a1f0 in cppu::WeakComponentImplHelperBase::dispose 
(this=0x555556dd1610) at 
/home/michi/development/git/libreoffice/cppuhelper/source/implbase.cxx:104
        #63 0x00007ffff4a02ba5 in 
cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, 
com::sun::star::frame::XFrame2, com::sun::star::awt::XWindowListener, 
com::sun::star::awt::XTopWindowListener, com::sun::star::awt::XFocusListener, 
com::sun::star::document::XActionLockable, com::sun::star::util::XCloseable, 
com::sun::star::frame::XComponentLoader, com::sun::star::frame::XTitle, 
com::sun::star::frame::XTitleChangeBroadcaster, 
com::sun::star::beans::XPropertySet, 
com::sun::star::beans::XPropertySetInfo>::dispose (this=0x555556dd1610) at 
include/cppuhelper/compbase.hxx:90
        #64 0x00007ffff49fb4d5 in (anonymous namespace)::XFrameImpl::close 
(this=0x555556dd1610, bDeliverOwnership=0 '
        #65 0x00007ffff4829850 in framework::pattern::frame::closeIt 
(xResource=uno::Reference to ((anonymous namespace)::XFrameImpl *) 
0x555556dd1680) at framework/source/inc/pattern/frame.hxx:57
        #66 0x00007ffff49b92fd in framework::LoadEnv::impl_reactForLoadingState 
(this=0x7fffffff57b8) at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1655
        #67 0x00007ffff49b8cf6 in framework::LoadEnv::impl_setResult 
(this=0x7fffffff57b8, bResult=true) at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:537
        #68 0x00007ffff49b8b31 in framework::LoadEnv::impl_loadContent 
(this=0x7fffffff57b8) at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1184
        #69 0x00007ffff49b5c85 in framework::LoadEnv::start 
(this=0x7fffffff57b8) at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:417
        #70 0x00007ffff49b3982 in framework::LoadEnv::startLoading
            (this=0x7fffffff57b8, 
sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott",
 lMediaDescriptor=uno::Sequence of length 3 = {...}, xBaseFrame=uno::Reference 
to (framework::Desktop *) 0x5555568ac098, sTarget="_default", nSearchFlags=0, 
eFeature=LoadEnvFeatures::WorkWithUI) at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:313
        #71 0x00007ffff49b2282 in framework::LoadEnv::loadComponentFromURL
            (xLoader=uno::Reference to (framework::Desktop *) 0x5555568ac0a8, 
xContext=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 
0x55555559d808, 
sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott",
 sTarget="_default", nSearchFlags=0, lArgs=uno::Sequence of length 3 = {...}) 
at 
/home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:169
        #72 0x00007ffff49e45d2 in framework::Desktop::loadComponentFromURL
            (this=0x5555568ac030, 
sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott",
 sTargetFrameName="_default", nSearchFlags=0, lArguments=uno::Sequence of 
length 3 = {...}) at 
/home/michi/development/git/libreoffice/framework/source/services/desktop.cxx:594
        #73 0x00007ffff49e4734 in non-virtual thunk to 
framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) ()
            at 
/home/michi/development/git/libreoffice/instdir/program/libfwklo.so
        #74 0x00007ffff3c6ef72 in SfxTemplateManagerDlg::EditTemplateHdl 
(this=0x7fffffffa218, 
rTemplatePath="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
            at 
/home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:715
        #75 0x00007ffff3c67eed in 
SfxTemplateManagerDlg::LinkStubEditTemplateHdl (instance=0x7fffffffa218, 
data="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
            at 
/home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:704
        #76 0x00007ffff36af081 in Link<rtl::OUString const&, void>::Call 
(this=0x7fffffffa520, 
data="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
            at include/tools/link.hxx:105
        #77 0x00007ffff382c9ab in TemplateDlgLocalView::ContextMenuSelectHdl 
(this=0x7fffffffa320, rIdent=u"edit") at 
/home/michi/development/git/libreoffice/sfx2/source/control/templatedlglocalview.cxx:154
        #78 0x00007ffff382c66a in TemplateDlgLocalView::createContextMenu 
(this=0x7fffffffa320, bIsDefault=false, bIsBuiltIn=true, bIsSingleSel=true, 
rDefaultImg="res/odt_16_8.png")
            at 
/home/michi/development/git/libreoffice/sfx2/source/control/templatedlglocalview.cxx:140
        #79 0x00007ffff3c6e710 in SfxTemplateManagerDlg::CreateContextMenuHdl 
(this=0x7fffffffa218, pItem=0x55555788ca90) at 
/home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:680
        #80 0x00007ffff3c67e5d in 
SfxTemplateManagerDlg::LinkStubCreateContextMenuHdl (instance=0x7fffffffa218, 
data=0x55555788ca90) at 
/home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:649
        #81 0x00007ffff381bce1 in Link<TemplateViewItem*, void>::Call 
(this=0x7fffffffa4e0, data=0x55555788ca90) at include/tools/link.hxx:105
        #82 0x00007ffff3816e34 in TemplateLocalView::Command 
(this=0x7fffffffa320, rCEvt=...) at 
/home/michi/development/git/libreoffice/sfx2/source/control/templatelocalview.cxx:718
        #83 0x00007fffee228e11 in weld::CustomWeld::DoCommand 
(this=0x55555779d480, rPos=...) at 
/home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:102
        #84 0x00007fffee228b1d in weld::CustomWeld::LinkStubDoCommand 
(instance=0x55555779d480, data=...) at 
/home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:100
        #85 0x00007fffeda99ed6 in Link<CommandEvent const&, bool>::Call 
(this=0x555557703ef0, data=...) at include/tools/link.hxx:105
        #86 0x00007fffee2813f1 in weld::Widget::signal_command 
(this=0x555557703ee0, rCEvt=...) at include/vcl/weld/weld.hxx:109
        #87 0x00007fffee247e74 in SalInstanceWidget::CommandHdl 
(this=0x555557703eb0, rEvent=...) at 
/home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:819
        #88 0x00007fffee244ccd in SalInstanceWidget::LinkStubCommandHdl 
(instance=0x555557703eb0, data=...) at 
/home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:817
        #89 0x00007fffeda99ed6 in Link<CommandEvent const&, bool>::Call 
(this=0x5555577f1080, data=...) at include/tools/link.hxx:105
        #90 0x00007fffedc2f524 in vcl::Window::Command (this=0x5555573055d0, 
rCEvt=...) at 
/home/michi/development/git/libreoffice/vcl/source/window/window.cxx:1933
        #91 0x00007fffedc4df45 in ImplCallCommand (pChild=..., 
nEvt=CommandEventId::ContextMenu, pData=0x0, bMouse=true, pPos=0x7fffffff7950) 
at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:258
        #92 0x00007fffedc4d68c in ImplHandleMouseEvent (xWindow=..., 
nSVEvent=NotifyEventType::MOUSEBUTTONDOWN, bMouseLeave=false, nX=125, nY=130, 
nMsgTime=71004093, nCode=4, nMode=MouseEventModifiers::NONE)
            at 
/home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:827
        #93 0x00007fffedc51581 in ImplHandleSalMouseButtonDown 
(pWindow=0x5555578924d0, pEvent=0x7fffffff8998) at 
/home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2367
        #94 0x00007fffedc501f1 in ImplWindowFrameProc (_pWindow=0x5555578924d0, 
nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffff8998) at 
/home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2705
        #95 0x00007fffe6215dcc in SalFrame::CallCallback (this=0x555557805e30, 
nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffff8998) at 
vcl/inc/salframe.hxx:310
        #96 0x00007fffe62be199 in X11SalFrame::HandleMouseEvent 
(this=0x555557805e30, pEvent=0x7fffffff8e68) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/window/salframe.cxx:2575
        #97 0x00007fffe62c1e97 in X11SalFrame::Dispatch (this=0x555557805e30, 
pEvent=0x7fffffff8e68) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/window/salframe.cxx:3642
        #98 0x00007fffe6231f7b in SalX11Display::Dispatch (this=0x555556884440, 
pEvent=0x7fffffff8e68) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1966
        #99 0x00007fffe6231802 in SalX11Display::Yield (this=0x555556884440) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1865
        #100 0x00007fffe62267df in DisplayYield (fd=5, data=0x555556884440) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:317
        #101 0x00007fffe622235c in (anonymous 
namespace)::YieldEntry::HandleNextEvent (this=0x7fffe63191e8 <yieldTable+200>) 
at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:559
        #102 0x00007fffe6222261 in SalXLib::Yield (this=0x5555555a3b00, 
bWait=true, bHandleAllCurrentEvents=false) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:751
        #103 0x00007fffe623f29d in X11SalInstance::DoYield 
(this=0x5555555a1ba0, bWait=true, bHandleAllCurrentEvents=false) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/salinst.cxx:189
        #104 0x00007fffee300306 in InnerYield (i_bWait=true, 
i_bAllEvents=false) at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:389
        #105 0x00007fffee2ffb8f in Application::Yield () at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:502
        #106 0x00007fffeda927db in Dialog::Execute (this=0x555557806110) at 
/home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1079
        #107 0x00007fffee2505ee in SalInstanceDialog::run (this=0x5555575f5100) 
at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:1859
        #108 0x00007fffee6b4c6e in weld::DialogController::run 
(this=0x7fffffffa218) at 
/home/michi/development/git/libreoffice/vcl/source/weld/DialogController.cxx:16
        #109 0x00007ffff3c68a94 in SfxTemplateManagerDlg::run 
(this=0x7fffffffa218) at 
/home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:262
        #110 0x00007ffff36578af in SfxApplication::NewDocExec_Impl 
(this=0x555556dbccf0, rReq=...) at 
/home/michi/development/git/libreoffice/sfx2/source/appl/appopen.cxx:473
        #111 0x00007ffff3650dd5 in SfxStubSfxApplicationNewDocExec_Impl 
(pShell=0x555556dbccf0, rReq=...) at 
workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:1310
        #112 0x00007ffff37aa26e in SfxDispatcher::Call_Impl 
(this=0x555556979a30, rShell=..., rSlot=..., rReq=..., bRecord=true) at 
/home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:256
        #113 0x00007ffff37b0156 in SfxDispatcher::PostMsgHandler 
(this=0x555556979a30, pReq=std::unique_ptr<SfxRequest> = {...}) at 
/home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:997
        #114 0x00007ffff3ca5458 in SfxHintPoster::DoEvent_Impl 
(this=0x555556db3930, pPostedHint=0x5555576ed980) at 
/home/michi/development/git/libreoffice/sfx2/source/notify/hintpost.cxx:74
        #115 0x00007ffff3ca539d in SfxHintPoster::LinkStubDoEvent_Impl 
(instance=0x555556db3930, data=0x5555576ed980) at 
/home/michi/development/git/libreoffice/sfx2/source/notify/hintpost.cxx:54
        #116 0x00007fffedc583f1 in Link<void*, void>::Call 
(this=0x5555577cabb8, data=0x5555576ed980) at include/tools/link.hxx:105
        #117 0x00007fffedc53d11 in ImplHandleUserEvent 
(pSVEvent=0x5555577cabb0) at 
/home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2314
        #118 0x00007fffedc50c3f in ImplWindowFrameProc 
(_pWindow=0x555556db2f40, nEvent=SalEvent::UserEvent, pEvent=0x5555577cabb0) at 
/home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2871
        #119 0x00007fffee830cbc in SalFrame::CallCallback (this=0x555556b048a0, 
nEvent=SalEvent::UserEvent, pEvent=0x5555577cabb0) at vcl/inc/salframe.hxx:310
        #120 0x00007fffee85721f in SalGenericDisplay::ProcessEvent 
(this=0x555556884440, aEvent=...) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/gendisp.cxx:66
        #121 0x00007fffee234c9d in 
SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const 
(this=0x7fffffffb390) at 
/home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
        #122 0x00007fffee234b6b in SalUserEventList::DispatchUserEvents 
(this=0x555556884440, bHandleAllCurrentEvents=false) at 
/home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
        #123 0x00007fffee857175 in SalGenericDisplay::DispatchInternalEvent 
(this=0x555556884440, bHandleAllCurrentEvent=false) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/gendisp.cxx:51
        #124 0x00007fffe6231784 in SalX11Display::Yield (this=0x555556884440) 
at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1856
        #125 0x00007fffe62267df in DisplayYield (fd=5, data=0x555556884440) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:317
        #126 0x00007fffe622235c in (anonymous 
namespace)::YieldEntry::HandleNextEvent (this=0x7fffe63191e8 <yieldTable+200>) 
at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:559
        #127 0x00007fffe6221bc9 in SalXLib::Yield (this=0x5555555a3b00, 
bWait=true, bHandleAllCurrentEvents=false) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:655
        #128 0x00007fffe623f29d in X11SalInstance::DoYield 
(this=0x5555555a1ba0, bWait=true, bHandleAllCurrentEvents=false) at 
/home/michi/development/git/libreoffice/vcl/unx/generic/app/salinst.cxx:189
        #129 0x00007fffee300306 in InnerYield (i_bWait=true, 
i_bAllEvents=false) at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:389
        #130 0x00007fffee2ffb8f in Application::Yield () at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:502
        #131 0x00007fffee2ff970 in Application::Execute () at 
/home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:364
        #132 0x00007ffff7b228b5 in desktop::Desktop::Main (this=0x7fffffffd550) 
at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1681
        #133 0x00007fffee329376 in ImplSVMain () at 
/home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
        #134 0x00007fffee32ae99 in SVMain () at 
/home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
        #135 0x00007ffff7b9c86a in soffice_main () at 
/home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
        #136 0x0000555555555a2d in sal_main () at 
/home/michi/development/git/libreoffice/desktop/source/app/main.c:51
        #137 0x0000555555555a07 in main (argc=1, argv=0x7fffffffd758) at 
/home/michi/development/git/libreoffice/desktop/source/app/main.c:49
    
    Change-Id: I06da3836405b46671785824fbcee8db863048685
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197637
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>
    (cherry picked from commit ab7a187b28ac1f40d47552d2ce05811dfa03fe59)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197722
    Tested-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>

diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 36c26f961194..db81c5ce4f3a 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -22,7 +22,6 @@
 #include <loadenv/loadenvexception.hxx>
 #include <loadenv/targethelper.hxx>
 #include <framework/framelistanalyzer.hxx>
-#include <pattern/frame.hxx>
 
 #include <interaction/quietinteraction.hxx>
 #include <properties.h>
@@ -1467,24 +1466,12 @@ css::uno::Reference< css::frame::XFrame > 
LoadEnv::impl_searchRecycleTarget()
 
     css::uno::Reference< css::frame::XFramesSupplier > xSupplier = 
css::frame::Desktop::create( m_xContext );
     FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference< 
css::frame::XFrame >(), FrameAnalyzerFlags::BackingComponent);
-
     if (aTasksAnalyzer.m_xBackingComponent.is())
     {
-        // new docs should recycle the backing window
-        if (ProtocolCheck::isProtocol(m_aURL.Complete, 
EProtocol::PrivateFactory)
-            || 
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ASTEMPLATE,
-                                                            false))
-        {
-            if 
(!impl_isFrameAlreadyUsedForLoading(aTasksAnalyzer.m_xBackingComponent))
-            {
-                m_bReactivateControllerOnError = true;
-                return aTasksAnalyzer.m_xBackingComponent;
-            }
-        }
-        // for docs with saved window state, let's create a new frame for 
their own size/pos
-        else
+        if 
(!impl_isFrameAlreadyUsedForLoading(aTasksAnalyzer.m_xBackingComponent))
         {
-            return {};
+            m_bReactivateControllerOnError = true;
+            return aTasksAnalyzer.m_xBackingComponent;
         }
     }
 
@@ -1647,13 +1634,6 @@ void LoadEnv::impl_reactForLoadingState()
             if (TargetHelper::isValidNameForFrame(sFrameName))
                 m_xTargetFrame->setName(sFrameName);
         }
-        // if a new frame is created without reusing backing window, close the 
backing window afterwards
-        FrameListAnalyzer 
aTasksAnalyzer(css::frame::Desktop::create(m_xContext), m_xTargetFrame,
-                                         FrameAnalyzerFlags::BackingComponent);
-        if (aTasksAnalyzer.m_xBackingComponent.is())
-        {
-            
framework::pattern::frame::closeIt(aTasksAnalyzer.m_xBackingComponent);
-        }
     }
     else if (m_bReactivateControllerOnError)
     {

Reply via email to