66
77static NSString *const RunnerGestureSynthesisSurface = @" event" ;
88
9- typedef id (*RunnerMsgSendInitRecord)(id , SEL , NSString *, NSInteger );
9+ typedef id (*RunnerMsgSendInitRecord)(id , SEL , NSString *, NSUInteger , NSInteger );
1010typedef id (*RunnerMsgSendInitPath)(id , SEL , CGPoint, NSTimeInterval );
1111typedef void (*RunnerMsgSendPathMove)(id , SEL , CGPoint, NSTimeInterval );
1212typedef 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.
1717typedef 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