Skip to content

Commit

Permalink
Moved the applet GetEventHandle code outside of the regularapp block …
Browse files Browse the repository at this point in the history
…since appletMainLoop() uses this event.
  • Loading branch information
yellows8 committed Feb 17, 2018
1 parent 3c6b8bb commit c22655e
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions nx/source/services/applet.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,36 +157,35 @@ Result appletInitialize(void)
if (R_SUCCEEDED(rc))
rc = _appletGetSession(&g_appletProxySession, &g_appletIDebugFunctions, 1000);

if (R_SUCCEEDED(rc) && (__nx_applet_type == AppletType_Application))
{
// ICommonStateGetter::GetEventHandle
// ICommonStateGetter::GetEventHandle
if (R_SUCCEEDED(rc))
rc = _appletGetHandle(&g_appletICommonStateGetter, &g_appletMessageEventHandle, 0);

if (R_SUCCEEDED(rc)) {
do {
svcWaitSynchronizationSingle(g_appletMessageEventHandle, U64_MAX);
if (R_SUCCEEDED(rc) && (__nx_applet_type == AppletType_Application))
{
do {
svcWaitSynchronizationSingle(g_appletMessageEventHandle, U64_MAX);

u32 msg;
rc = _appletReceiveMessage(&msg);
u32 msg;
rc = _appletReceiveMessage(&msg);

if (R_FAILED(rc))
{
if ((rc & 0x3fffff) == 0x680)
continue;
if (R_FAILED(rc))
{
if ((rc & 0x3fffff) == 0x680)
continue;

break;
}
break;
}

if (msg != 0xF)
continue;
if (msg != 0xF)
continue;

rc = _appletGetCurrentFocusState(&g_appletFocusState);
rc = _appletGetCurrentFocusState(&g_appletFocusState);

if (R_FAILED(rc))
break;
if (R_FAILED(rc))
break;

} while(g_appletFocusState!=1);
}
} while(g_appletFocusState!=1);

if (R_SUCCEEDED(rc))
rc = _appletAcquireForegroundRights();
Expand Down

0 comments on commit c22655e

Please sign in to comment.