mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +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)
|
elseif(IOS)
|
||||||
set(nativeExtra ${nativeExtra}
|
set(nativeExtra ${nativeExtra}
|
||||||
ios/main.mm
|
ios/main.mm
|
||||||
ios/AppDelegate.m
|
ios/AppDelegate.mm
|
||||||
ios/AppDelegate.h
|
ios/AppDelegate.h
|
||||||
ios/ViewController.mm
|
ios/ViewController.mm
|
||||||
ios/ViewController.h
|
ios/ViewController.h
|
||||||
@ -752,7 +752,7 @@ elseif(IOS)
|
|||||||
set(nativeExtraLibs ${nativeExtraLibs} "-weak_framework GameController")
|
set(nativeExtraLibs ${nativeExtraLibs} "-weak_framework GameController")
|
||||||
endif()
|
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_source_files_properties(ios/ViewController.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||||
|
|
||||||
set(TargetBin PPSSPP)
|
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