summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-01-22 09:34:47 +0300
committerAron Budea <aron.budea@collabora.com>2018-01-30 11:04:43 +0100
commit8cb5f72b41449f5c7e655a04372c407de1679851 (patch)
tree7b386d4d5abca4dbc01acd1cf36a073200adeb97 /vcl
parent150d6f4e7490b06ff7c1c9062f718a1afe446afd (diff)
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 <Samuel.Mehrbrodt@cib.de> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/48873 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index f9dbaa534f5f..79d7f224ab43 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
+#include <officecfg/Office/Common.hxx>
#include <osl/file.hxx>
#include <tools/debug.hxx>
@@ -880,12 +881,14 @@ 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++;
- css::uno::Reference< css::uno::XComponentContext > xContext(
- comphelper::getProcessComponentContext() );
css::uno::Reference<css::frame::XGlobalEventBroadcaster> xEventBroadcaster(css::frame::theGlobalEventBroadcaster::get(xContext), css::uno::UNO_QUERY_THROW);
css::document::DocumentEvent aObject;
aObject.EventName = "DialogExecute";