Cleanup[input]: remove glfw window focus state callback

This is unnecessary (no background code execution unless given keepalive permission) and is prone to JNI error
This commit is contained in:
khanhduytran0 committed 2023-09-20 17:29:05 +07:00
1 parent 980ddd35a2
commit 32d2d785eb
2 files changed
-25

No files matched your search

-21
View File
@@ -8,11 +8,6 @@ extern dispatch_group_t fatalExitGroup;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}
#pragma mark - UISceneSession lifecycle
@@ -29,22 +24,6 @@ extern dispatch_group_t fatalExitGroup;
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
CallbackBridge_setWindowAttrib(GLFW_FOCUSED, 1);
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
CallbackBridge_setWindowAttrib(GLFW_VISIBLE, 0);
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
CallbackBridge_setWindowAttrib(GLFW_VISIBLE, 1);
}
- (void)applicationWillResignActive:(UIApplication *)application {
CallbackBridge_setWindowAttrib(GLFW_FOCUSED, 0);
}
- (void)applicationWillTerminate:(UIApplication *)application {
if (fatalExitGroup != nil) {
dispatch_group_leave(fatalExitGroup);
-4
View File
@@ -29,21 +29,18 @@
- (void)sceneDidBecomeActive:(UIScene *)scene {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
CallbackBridge_setWindowAttrib(GLFW_FOCUSED, 1);
}
- (void)sceneWillResignActive:(UIScene *)scene {
// Called when the scene will move from an active state to an inactive state.
// This may occur due to temporary interruptions (ex. an incoming phone call).
CallbackBridge_setWindowAttrib(GLFW_FOCUSED, 0);
}
- (void)sceneWillEnterForeground:(UIScene *)scene {
// Called as the scene transitions from the background to the foreground.
// Use this method to undo the changes made on entering the background.
CallbackBridge_setWindowAttrib(GLFW_VISIBLE, 1);
}
@@ -51,7 +48,6 @@
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
CallbackBridge_setWindowAttrib(GLFW_VISIBLE, 0);
}
@end