diff options
author | Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> | 2016-01-05 13:47:21 +0100 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> | 2016-01-05 13:04:09 +0000 |
commit | 3c086e50d36f4cba566ed366bc546744372aec40 (patch) | |
tree | e5ff7a9610de41523306af0c3a70455b4bf6a15b /src/winmain | |
parent | 275f182872fa2671da9445ba6295f50f2c283ae6 (diff) |
winrt: handle PrelaunchActivated property to pass certification
Windows 10 requires apps to handle the PrelaunchActivated property. This
enables a faster startup by launching an app and immediately suspending
it. This happens by the system and at the time the user launches the app
no library loading or initialization is required.
By default we opt-out of this and return early. The reason is that we
cannot know the type of application written in Qt and whether it breaks
the guidelines by using prelaunch. For further details check here:
https://msdn.microsoft.com/en-us/library/windows/apps/mt593297.aspx
Task-number: QTBUG-50292
Change-Id: I4d0b0b95a03f93b99211d042895404a88ea7cb9d
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'src/winmain')
-rw-r--r-- | src/winmain/qtmain_winrt.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 098ae45dc8..9e5f206ea5 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -198,6 +198,15 @@ private: HRESULT __stdcall OnLaunched(ILaunchActivatedEventArgs *launchArgs) Q_DECL_OVERRIDE { #if _MSC_VER >= 1900 + ComPtr<IPrelaunchActivatedEventArgs> preArgs; + HRESULT hr = launchArgs->QueryInterface(preArgs.GetAddressOf()); + if (SUCCEEDED(hr)) { + boolean prelaunched; + preArgs->get_PrelaunchActivated(&prelaunched); + if (prelaunched) + return S_OK; + } + commandLine = QString::fromWCharArray(GetCommandLine()).toUtf8(); #endif HString launchCommandLine; |