Skip to content

Commit

Permalink
winrt: handle PrelaunchActivated property to pass certification
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Maurice Kalinowski committed Jan 5, 2016
1 parent 275f182 commit 3c086e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/winmain/qtmain_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ class AppContainer : public RuntimeClass<Xaml::IApplicationOverrides>
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;
Expand Down

0 comments on commit 3c086e5

Please sign in to comment.