iOS: Pass through touches near the task switcher only in-game. Makes the UI better behaved.

This commit is contained in:
Henrik Rydgård committed 2024-05-26 10:27:14 +02:00
1 parent f42f7ac9d1
commit c26de64d0f
6 files changed
+45 -3

No files matched your search

+1
View File
@@ -229,6 +229,7 @@ enum class SystemNotification {
TEST_JAVA_EXCEPTION,
KEEP_SCREEN_AWAKE,
ACTIVITY,
UI_STATE_CHANGED,
};
// I guess it's not super great architecturally to centralize this, since it's not general - but same with a lot of
+1
View File
@@ -128,6 +128,7 @@ void UpdateUIState(GlobalUIState newState) {
if (globalUIState != newState && globalUIState != UISTATE_EXIT) {
globalUIState = newState;
System_Notify(SystemNotification::DISASSEMBLY);
System_Notify(SystemNotification::UI_STATE_CHANGED);
System_SetKeepScreenBright(globalUIState == UISTATE_INGAME);
}
}
+16 -1
View File
@@ -392,7 +392,22 @@ void GLRenderLoop(IOSGLESContext *graphicsContext) {
// Enables tapping for edge area.
-(UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
return UIRectEdgeAll;
if (GetUIState() == UISTATE_INGAME) {
// In-game, we need all the control we can get. Though, we could possibly
// allow the top edge?
INFO_LOG(SYSTEM, "Defer system gestures on all edges");
return UIRectEdgeAll;
} else {
INFO_LOG(SYSTEM, "Allow system gestures on the bottom");
// Allow task switching gestures to take precedence, without causing
// scroll events in the UI.
return UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeRight;
}
}
- (void)uiStateChanged
{
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
- (UIView *)getView {
+2
View File
@@ -20,6 +20,8 @@
- (void)didBecomeActive;
- (void)willResignActive;
- (void)uiStateChanged;
@end
extern id <PPSSPPViewController> sharedViewController;
+16 -1
View File
@@ -477,7 +477,22 @@ extern float g_safeInsetBottom;
// Enables tapping for edge area.
-(UIRectEdge)preferredScreenEdgesDeferringSystemGestures
{
return UIRectEdgeAll;
if (GetUIState() == UISTATE_INGAME) {
// In-game, we need all the control we can get. Though, we could possibly
// allow the top edge?
INFO_LOG(SYSTEM, "Defer system gestures on all edges");
return UIRectEdgeAll;
} else {
INFO_LOG(SYSTEM, "Allow system gestures on the bottom");
// Allow task switching gestures to take precedence, without causing
// scroll events in the UI.
return UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeRight;
}
}
- (void)uiStateChanged
{
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
- (void)bindDefaultFBO
+9 -1
View File
@@ -386,7 +386,15 @@ bool System_GetPropertyBool(SystemProperty prop) {
void System_Notify(SystemNotification notification) {
switch (notification) {
default: break;
case SystemNotification::UI_STATE_CHANGED:
dispatch_async(dispatch_get_main_queue(), ^{
if (sharedViewController) {
[sharedViewController uiStateChanged];
}
});
break;
default:
break;
}
}