applet: appletSetFocusHandlingMode should only be used with Application

This commit is contained in:
fincs 2020-03-10 17:42:00 +01:00
parent 7ce58f84e0
commit 8421863c78
No known key found for this signature in database
GPG Key ID: 62C7609ADA219C60
2 changed files with 6 additions and 0 deletions

View File

@ -2468,6 +2468,10 @@ AppletOperationMode appletGetOperationMode(void);
ApmPerformanceMode appletGetPerformanceMode(void);
AppletFocusState appletGetFocusState(void);
/**
* @brief Sets the current \ref AppletFocusHandlingMode.
* @note Should only be called with AppletType_Application.
*/
Result appletSetFocusHandlingMode(AppletFocusHandlingMode mode);
///@}

View File

@ -541,6 +541,8 @@ Result appletSetFocusHandlingMode(AppletFocusHandlingMode mode) {
Result rc;
bool invals[4];
if (__nx_applet_type != AppletType_Application)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
if (mode >= AppletFocusHandlingMode_Max)
return MAKERESULT(Module_Libnx, LibnxError_BadInput);