From 5943ef41a382d2c9ce42ff25ab67530193023334 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 22 Jan 2018 09:34:47 +0300 Subject: tdf#32935 tdf#49134 tdf#114466 Activate newly opened modal dialogs ... based on ForceFocusAndToFront setting Change-Id: Ic76faa082f433d5a0150e49c30d7eda3c6c24c5f Reviewed-on: https://gerrit.libreoffice.org/48287 Reviewed-by: Samuel Mehrbrodt Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/48884 Reviewed-by: Aron Budea Tested-by: Aron Budea --- vcl/source/window/dialog.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index bf975b465cbb..7bede952a16e 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -847,7 +848,11 @@ bool Dialog::ImplStartExecuteModal() // FIXME: no layouting, workaround some clipping issues ImplAdjustNWFSizes(); - Show(); + css::uno::Reference< css::uno::XComponentContext > xContext( + comphelper::getProcessComponentContext()); + bool bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext)); + ShowFlags showFlags = bForceFocusAndToFront ? ShowFlags::ForegroundTask : ShowFlags::NONE; + Show(true, showFlags); pSVData->maAppData.mnModalMode++; return true; -- cgit v1.2.3