summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/winmain/qtmain_winrt.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp
index 83a7dc800c..e49817ada4 100644
--- a/src/winmain/qtmain_winrt.cpp
+++ b/src/winmain/qtmain_winrt.cpp
@@ -198,6 +198,14 @@ public:
private:
HRESULT activatedLaunch(IInspectable *activateArgs) {
+ // Check if an application instance is already running
+ // This is mostly needed for Windows Phone and file pickers
+ QAbstractEventDispatcher *dispatcher = QCoreApplication::eventDispatcher();
+ if (dispatcher) {
+ QCoreApplication::postEvent(dispatcher, new QActivationEvent(activateArgs));
+ return S_OK;
+ }
+
QCoreApplication *app = QCoreApplication::instance();
// Check whether the app already runs