summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-04-05 16:07:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-04-05 22:24:12 +0200
commit7f9b3a0214e0c5d69e2becf2084fbf6e3defa090 (patch)
tree6d4a720a1e8986f156d7ed809cc8b45bef082730 /framework/source
parent8c3e219a831719ebb40dd2af8a26b0a24ad7aba1 (diff)
Resolves: tdf#154308 if start center frame exists, use it as dialog parent
At least for the case the document is launched from the StartCenter, put that StartCenter as the parent for any dialogs that may appear during typedetection, this avoids such dialogs not getting associated with the start center and going behind the dialog if the start center is clicked while the dialog was appearing. The start center is always recycled to become the next document if it exists, so its window is the window the final document would appear in if successful. Change-Id: I75a92ff424aa0b9d5d6b808e2f7f1766a80fa50c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/loadenv/loadenv.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 0d56944a3b17..0684c7b5fa69 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -322,7 +322,16 @@ void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::uno::XCompon
nUpdateMode = css::document::UpdateDocMode::ACCORDING_TO_CONFIG;
try
{
- xInteractionHandler.set( css::task::InteractionHandler::createWithParent( i_rxContext, nullptr ), css::uno::UNO_QUERY_THROW );
+ // tdf#154308 At least for the case the document is launched from the StartCenter, put that StartCenter as the
+ // parent for any dialogs that may appear during typedetection (once load starts a permanent frame will be set
+ // anyway and used as dialog parent, which will be this one if the startcenter was running)
+ css::uno::Reference<css::frame::XFramesSupplier> xSupplier = css::frame::Desktop::create(i_rxContext);
+ FrameListAnalyzer aTasksAnalyzer(xSupplier, css::uno::Reference<css::frame::XFrame>(), FrameAnalyzerFlags::BackingComponent);
+ css::uno::Reference<css::awt::XWindow> xDialogParent(aTasksAnalyzer.m_xBackingComponent ?
+ aTasksAnalyzer.m_xBackingComponent->getContainerWindow() :
+ nullptr);
+
+ xInteractionHandler.set( css::task::InteractionHandler::createWithParent(i_rxContext, xDialogParent), css::uno::UNO_QUERY_THROW );
}
catch(const css::uno::RuntimeException&) {throw;}
catch(const css::uno::Exception& ) { }