We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1202

Summary: Touch Events Invalid in Landscape Mode
Product: SDL Reporter: Armin Ronacher <armin.ronacher>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: vitto.giova
Version: HG 2.0   
Hardware: iPhone/iPod touch   
OS: iOS (All)   
Attachments: alternative possible patch?
updated patch

Description Armin Ronacher 2011-05-08 00:59:25 UTC
The custom rotation mode for iOS does not rotate the actual UIView that is rendering.  Because however the framebuffer is managed separately the whole thing just draws outside of it's wicket rotation, not really causing any troubles.

However the right side of the screen (or if flipped the left side) will no longer have a UIView and no longer respond to events.  A quick fix would be to have a window subclass that always returns the first view on hit test, independently of how large the thing actually is.

Secondly the touch object's internal axis resolutions also have to be adopted or the scaling is wrong.

A hacky patch is attached, but I don't recommend committing it but fixing the actual problem.  I started a discussion on the mailinglist about this topic, consider this bug record here mostly so it does not get lost.

Link to discussion: http://forums.libsdl.org/viewtopic.php?p=28828
Comment 1 Vittorio Giovara 2011-08-22 17:49:53 UTC
Created attachment 680 [details]
alternative possible patch?

What about this solution?
This keeps the uiwindow frame constant notwithstanding the current rotation position.
Comment 2 Vittorio Giovara 2011-10-27 19:00:52 UTC
actually my alternative doesn't take into account which screen we are running on; so a better fix would be [[uiscreen] bounds]
Comment 3 Vittorio Giovara 2011-10-27 19:02:05 UTC
(In reply to comment #2)
> actually my alternative doesn't take into account which screen we are running
> on; so a better fix would be [[uiscreen] bounds]

typo.

-    [uiwindow setFrame:frame];
+    [uiwindow setFrame:[uiscreen bounds]];
Comment 4 Vittorio Giovara 2011-10-29 06:18:33 UTC
Created attachment 724 [details]
updated patch
Comment 5 Vittorio Giovara 2011-11-20 08:54:53 UTC
this should have been fixed by Sam in d7135957b216