SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 69bb4c3e952aea8e0a8e00de4ebd602e0eb3c7db parent ae2d68aaf3c6a4cabe32a34919ad9d4a13790604 Author: Lior Halphon <LIJI32@gmail.com> Date: Sun, 29 Jun 2025 20:17:05 +0300 Fix various iPadOS bugs Diffstat:
| M | iOS/GBLayout.m | 6 | +++++- |
| M | iOS/GBMenuViewController.m | 6 | +++++- |
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/iOS/GBLayout.m b/iOS/GBLayout.m @@ -12,6 +12,10 @@ static double StatusBarHeight(void) UIEdgeInsets insets = window.safeAreaInsets; ret = MAX(MAX(insets.left, insets.right), MAX(insets.top, insets.bottom)) ?: 20; [window setHidden:true]; + if (!ret && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + ret = 32; // iPadOS is buggy af + } + NSLog(@"height = %f", ret); } }); return ret; @@ -47,7 +51,7 @@ static bool HasHomeBar(void) } _minY = StatusBarHeight() * _factor; - _cutout = _minY <= 24 * _factor? 0 : _minY; + _cutout = (_minY <= 24 * _factor || [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)? 0 : _minY; if (HasHomeBar()) { _homeBar = 21 * _factor; diff --git a/iOS/GBMenuViewController.m b/iOS/GBMenuViewController.m @@ -156,8 +156,12 @@ static NSString *const tips[] = { limitedToNumberOfLines:3].size; size.width = ceil(size.width); _tipLabel.frame = (CGRect){{8, 8}, size}; + unsigned topInset = view.window.safeAreaInsets.top; + if (!topInset && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + topInset = 32; // iPadOS is buggy af + } _effectView.frame = (CGRect) { - {round((outerSize.width - size.width - 16) / 2), view.window.safeAreaInsets.top + 12}, + {round((outerSize.width - size.width - 16) / 2), topInset + 12}, {size.width + 16, size.height + 16} }; }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.