Skip to content

Commit a2f0e20

Browse files
committed
fix(ios): route foldable interactions through the resolved window
1 parent f552c5e commit a2f0e20

16 files changed

Lines changed: 1360 additions & 1231 deletions

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests-Bridging-Header.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
#import "RunnerAXSnapshotBridge.h"
33
#import "RunnerSynthesizedGesture.h"
44
#import "RunnerSynthesizedTextEntry.h"
5+
#import "RunnerXCTestEventBridge.h"

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
static NSString *const RunnerGestureSynthesisSurface = @"event";
88

9-
typedef id (*RunnerMsgSendInitRecord)(id, SEL, NSString *, NSInteger);
9+
typedef id (*RunnerMsgSendInitRecord)(id, SEL, NSString *, NSUInteger, NSInteger);
1010
typedef id (*RunnerMsgSendInitPath)(id, SEL, CGPoint, NSTimeInterval);
1111
typedef void (*RunnerMsgSendPathMove)(id, SEL, CGPoint, NSTimeInterval);
1212
typedef void (*RunnerMsgSendPathOffset)(id, SEL, NSTimeInterval);
1313

14-
// Gesture-specific extension of the shared bridge: the 2-arg
15-
// `initWithName:interfaceOrientation:` record initializer and the touch-path
14+
// Gesture-specific extension of the shared bridge: the display-aware
15+
// `initWithName:displayID:interfaceOrientation:` record initializer and the touch-path
1616
// factory/mutator selectors, none of which text-entry synthesis needs.
1717
typedef struct {
1818
RunnerXCTestEventBridge core;
@@ -271,14 +271,14 @@ + (NSInteger)interfaceOrientationForApplication:(id)application {
271271
NSString *missing = RunnerResolveXCTestEventBridge(application, RunnerGestureSynthesisSurface, &core);
272272
if (missing != nil) return missing;
273273

274-
SEL initRecordSelector = NSSelectorFromString(@"initWithName:interfaceOrientation:");
274+
SEL initRecordSelector = NSSelectorFromString(@"initWithName:displayID:interfaceOrientation:");
275275
SEL interfaceOrientationSelector = NSSelectorFromString(@"interfaceOrientation");
276276
SEL initPathSelector = NSSelectorFromString(@"initForTouchAtPoint:offset:");
277277
SEL moveSelector = NSSelectorFromString(@"moveToPoint:atOffset:");
278278
SEL liftSelector = NSSelectorFromString(@"liftUpAtOffset:");
279279

280280
missing = RunnerRequireSelector(
281-
core.recordClass, initRecordSelector, @"initWithName:interfaceOrientation:", RunnerGestureSynthesisSurface
281+
core.recordClass, initRecordSelector, @"initWithName:displayID:interfaceOrientation:", RunnerGestureSynthesisSurface
282282
);
283283
if (missing != nil) return missing;
284284
missing = RunnerRequireSelector(
@@ -318,6 +318,9 @@ + (NSInteger)interfaceOrientationForApplication:(id)application {
318318
NSString *missing = RunnerResolveGestureEventBridge(application, bridge);
319319
if (missing != nil) return missing;
320320

321+
NSUInteger displayID = 0;
322+
NSString *displayError = RunnerResolveApplicationDisplayID(application, &displayID);
323+
if (displayError != nil) return displayError;
321324
NSInteger interfaceOrientation =
322325
((RunnerMsgSendInteger)objc_msgSend)(application, bridge->interfaceOrientationSelector);
323326
NSInteger targetProcessID =
@@ -330,6 +333,7 @@ + (NSInteger)interfaceOrientationForApplication:(id)application {
330333
[bridge->core.recordClass alloc],
331334
bridge->initRecordSelector,
332335
recordName,
336+
displayID,
333337
interfaceOrientation
334338
);
335339
if (eventRecord == nil) {

0 commit comments

Comments
 (0)