mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Moved the applet GetEventHandle code outside of the regularapp block since appletMainLoop() uses this event.
This commit is contained in:
parent
3c6b8bb6dd
commit
c22655e7a2
@ -157,36 +157,35 @@ Result appletInitialize(void)
|
|||||||
if (R_SUCCEEDED(rc))
|
if (R_SUCCEEDED(rc))
|
||||||
rc = _appletGetSession(&g_appletProxySession, &g_appletIDebugFunctions, 1000);
|
rc = _appletGetSession(&g_appletProxySession, &g_appletIDebugFunctions, 1000);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc) && (__nx_applet_type == AppletType_Application))
|
// ICommonStateGetter::GetEventHandle
|
||||||
{
|
if (R_SUCCEEDED(rc))
|
||||||
// ICommonStateGetter::GetEventHandle
|
|
||||||
rc = _appletGetHandle(&g_appletICommonStateGetter, &g_appletMessageEventHandle, 0);
|
rc = _appletGetHandle(&g_appletICommonStateGetter, &g_appletMessageEventHandle, 0);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc) && (__nx_applet_type == AppletType_Application))
|
||||||
do {
|
{
|
||||||
svcWaitSynchronizationSingle(g_appletMessageEventHandle, U64_MAX);
|
do {
|
||||||
|
svcWaitSynchronizationSingle(g_appletMessageEventHandle, U64_MAX);
|
||||||
|
|
||||||
u32 msg;
|
u32 msg;
|
||||||
rc = _appletReceiveMessage(&msg);
|
rc = _appletReceiveMessage(&msg);
|
||||||
|
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
{
|
{
|
||||||
if ((rc & 0x3fffff) == 0x680)
|
if ((rc & 0x3fffff) == 0x680)
|
||||||
continue;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg != 0xF)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rc = _appletGetCurrentFocusState(&g_appletFocusState);
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (R_FAILED(rc))
|
if (msg != 0xF)
|
||||||
break;
|
continue;
|
||||||
|
|
||||||
} while(g_appletFocusState!=1);
|
rc = _appletGetCurrentFocusState(&g_appletFocusState);
|
||||||
}
|
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
break;
|
||||||
|
|
||||||
|
} while(g_appletFocusState!=1);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc))
|
if (R_SUCCEEDED(rc))
|
||||||
rc = _appletAcquireForegroundRights();
|
rc = _appletAcquireForegroundRights();
|
||||||
|
Loading…
Reference in New Issue
Block a user