diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-23 09:04:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-23 09:04:43 +0200 |
commit | de6783eaca9c6d95f02b6998ac63eaa622bac19a (patch) | |
tree | a196c5bf075794949b456b9683566a0048a23b40 /platform | |
parent | 73f1f9b44ffa0ab64326e2158d859c78c12a32fc (diff) | |
parent | e0df9de0cb307b415e23a5157092eb5c8334c6b0 (diff) |
Merge pull request #31543 from fogine/#31503-ios-touch-events-stolen
Fixes iOS>=11 stealing touch events
Diffstat (limited to 'platform')
-rw-r--r-- | platform/iphone/view_controller.h | 4 | ||||
-rw-r--r-- | platform/iphone/view_controller.mm | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/platform/iphone/view_controller.h b/platform/iphone/view_controller.h index fc18661f62..68e3bc64fc 100644 --- a/platform/iphone/view_controller.h +++ b/platform/iphone/view_controller.h @@ -39,6 +39,10 @@ - (void)didReceiveMemoryWarning; +- (void)viewDidLoad; + +- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures; + - (BOOL)prefersStatusBarHidden; @end diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 0358abf9e2..e52ad92bf2 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -83,6 +83,18 @@ int add_cmdline(int p_argc, char **p_args) { printf("*********** did receive memory warning!\n"); }; +- (void)viewDidLoad { + [super viewDidLoad]; + + if (@available(iOS 11.0, *)) { + [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures]; + } +} + +- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures { + return UIRectEdgeAll; +} + - (BOOL)shouldAutorotate { switch (OS::get_singleton()->get_screen_orientation()) { case OS::SCREEN_SENSOR: |