ffi 1.25: uikit safeAreaInsets via #objc_call
First Phase 1D migration cluster. `uikit_refresh_safe_insets` reads `safeAreaInsets` through `#objc_call(UIEdgeInsets)` instead of the hand-typed `objc_msgSend` cast + `sel_registerName` triple, and a dead `sel_safe_insets` selector decl in `uikit_scene_will_connect_ios` goes away with it. Net -3 lines. iOS-sim chess regression smoke: SxChess launches, board renders with correct status-bar clearance — `safe_top` is populated correctly, which is the actual ABI under test (32 B HFA returned in v0..v3).
This commit is contained in:
@@ -266,9 +266,7 @@ uikit_refresh_safe_insets :: (plat: *UIKitPlatform) {
|
||||
inline if OS != .ios { return; }
|
||||
if plat.gl_view == null { return; }
|
||||
|
||||
sel_safe := sel_registerName("safeAreaInsets".ptr);
|
||||
msg_insets : (*void, *void) -> UIEdgeInsets = xx objc_msgSend;
|
||||
i := msg_insets(plat.gl_view, sel_safe);
|
||||
i := #objc_call(UIEdgeInsets)(plat.gl_view, "safeAreaInsets");
|
||||
plat.safe_top = xx i.top;
|
||||
plat.safe_left = xx i.left;
|
||||
plat.safe_bottom = xx i.bottom;
|
||||
@@ -545,7 +543,6 @@ uikit_scene_will_connect_ios :: (delegate: *void, scene: *void) {
|
||||
sel_add_to_runloop := sel_registerName("addToRunLoop:forMode:".ptr);
|
||||
sel_current_runloop := sel_registerName("currentRunLoop".ptr);
|
||||
sel_tick := sel_registerName("sxTick:".ptr);
|
||||
sel_safe_insets := sel_registerName("safeAreaInsets".ptr);
|
||||
|
||||
msg_o : (*void, *void) -> *void = xx objc_msgSend;
|
||||
msg_v : (*void, *void) -> void = xx objc_msgSend;
|
||||
|
||||
Reference in New Issue
Block a user