iOS 9.0: On iPad multitasking, app on right-hand side returns incorrect tap coordinates (slide-over, split-view, or side-by-side)

Originator:rsattar
Number:rdar://22670063 Date Originated:11-Sep-2015 04:11 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 9.0 (13A341)
Classification:Serious Bug Reproducible:Always
 
Summary:
On an iOS 9.0 iPad, tap coordinates are reported incorrectly if the app is on the right-hand side (using slide-over, split-view or side-by-side mode)

Steps to Reproduce:
1) Build and run attached Xcode project in Xcode 7.0 (7A218) on an iPad, or iPad simulator
2) Home-screen the app
3) Open another app (e.g. Mobile Safari)
4) Bring iOS9WindowOffset app to the right-hand side using slide-over.
5) Tap in the bottom left corner


Expected Results:
The “Current coordinate space point” should report the tap as being in the bottom left of the window.

Actual Results:
The “Current coordinate space point” is actually negative, because iOS internally is converting the touch point (e.g. 0, 0) against the shifted over frame of the window (e.g. 448, 0), even though the window’s origin is reported to the app as (0,0).

Regression:
In older betas, I’ve been told this was working as expected, and that the actual window frame was not “leaked” as in this case.

Notes:
Essentially the tap code should be:
CGPoint touchPoint = [recognizer locationInView:nil];
touchPoint = [window convertPoint:touchPoint fromCoordinateSpace:window.screen.fixedCoordinateSpace];

… but with the bug above, you have to determine the actual non-zero window frame, and then apply a translation to the converted point.

With this bug, it’s possible to determine the actual, non-zero window frame of your app, something which Apple engineers said should not be possible. While this might actually be useful for developers, the incorrect conversion of the touch point means every app developer has to calculate the actual window offset and then “translate” the converted point to the actually usable point.

I’ve attached the Xcode project, but in case you can’t get it, download it as a zip from: http://cl.ly/1Y080C2B192c

Comments

New version of the sample project: http://cl.ly/1Y080C2B192c

Added a screenshot:


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!