mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-27 10:20:49 +00:00
Properly post lost_focus and got_focus notifications when iOS app resigns active state and gains active state. Fixes #7758
This commit is contained in:
parent
64f20033d4
commit
dbd15420f5
@ -738,7 +738,7 @@ if(ANDROID)
|
||||
elseif(IOS)
|
||||
set(nativeExtra ${nativeExtra}
|
||||
ios/main.mm
|
||||
ios/AppDelegate.m
|
||||
ios/AppDelegate.mm
|
||||
ios/AppDelegate.h
|
||||
ios/ViewController.mm
|
||||
ios/ViewController.h
|
||||
@ -752,7 +752,7 @@ elseif(IOS)
|
||||
set(nativeExtraLibs ${nativeExtraLibs} "-weak_framework GameController")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(ios/AppDelegate.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
set_source_files_properties(ios/AppDelegate.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
set_source_files_properties(ios/ViewController.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
|
||||
set(TargetBin PPSSPP)
|
||||
|
@ -1,18 +0,0 @@
|
||||
// AppDelegate.m boilerplate
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import "ViewController.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.viewController = [[ViewController alloc] init];
|
||||
self.window.rootViewController = self.viewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
21
ios/AppDelegate.mm
Normal file
21
ios/AppDelegate.mm
Normal file
@ -0,0 +1,21 @@
|
||||
#import "AppDelegate.h"
|
||||
#import "ViewController.h"
|
||||
#import "base/NativeApp.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
-(BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.viewController = [[ViewController alloc] init];
|
||||
self.window.rootViewController = self.viewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) applicationWillResignActive:(UIApplication *)application {
|
||||
NativeMessageReceived("lost_focus", "");
|
||||
}
|
||||
|
||||
-(void) applicationDidBecomeActive:(UIApplication *)application {
|
||||
NativeMessageReceived("got_focus", "");
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue
Block a user