iOS>=11 platform - when handling gestures on screen edges, godot apps should have priority over OS

Solves an issue where iOS would steal InputEventTouch events when near
screen edges in order to handle system wide gestures.
Fixes #31503
This commit is contained in:
fogine 2019-08-21 18:55:21 +02:00
parent 3bd49dabfa
commit e0df9de0cb
2 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,10 @@
- (void)didReceiveMemoryWarning; - (void)didReceiveMemoryWarning;
- (void)viewDidLoad;
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures;
- (BOOL)prefersStatusBarHidden; - (BOOL)prefersStatusBarHidden;
@end @end

View File

@ -83,6 +83,18 @@ int add_cmdline(int p_argc, char **p_args) {
printf("*********** did receive memory warning!\n"); printf("*********** did receive memory warning!\n");
}; };
- (void)viewDidLoad {
[super viewDidLoad];
if (@available(iOS 11.0, *)) {
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
}
}
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
return UIRectEdgeAll;
}
- (BOOL)shouldAutorotate { - (BOOL)shouldAutorotate {
switch (OS::get_singleton()->get_screen_orientation()) { switch (OS::get_singleton()->get_screen_orientation()) {
case OS::SCREEN_SENSOR: case OS::SCREEN_SENSOR: