Touch event can freeze Corona

I recently posted a topic on, what I believed to be at the time, an issue with dragging display groups

http://developer.anscamobile.com/forum/2011/01/28/no-updates-while-dragging-display-group

I have since found that when a touch event occurs (it seems to be more specifically when it is flagged as “moved”) there are cases where render updates can completely stop until coming out of that event state.

On my iPhone 3GS (I only get this on device as things run much quicker in the simulator on my mac) I am observing this when either:

a. I have a somewhat intensive method called during the touch event (in my case it was an attempt at culling sprites outside the screen area)

b. When a touch event occurs and the frame rate is already choppy

Now while I might expect a frame or two to get lost when things get heavy I certainly wouldn’t have expected render updates to entirely stall while keeping the touch event in the moved state (what I have been seeing). It would seem that logical updates are still occurring as the position of the sprites I am dragging move to where one might expect after n number of updates. What is strange, especially with case a. is that the method I attempted to use in the touch event can actually be called per frame (using timer with a 33ms delay set forever) in the same application and run quite smoothly - assuming the frame rate was smooth to start with.

Is this something that you/anyone has observed?

Best Regards
Hobsie [import]uid: 5883 topic_id: 5888 reply_id: 305888[/import]

I have seen similar behavior,

I have a game with a timer, when the timer gets close to the end the user may begin to frantically tap the screen, selecting many objects, trying to save the level. If the touch event is past the “begin” phase and the application removes all the objects from the screen, like when the level is has ended, the last phase of the last touch event shows up as “moved”, the event phase never progressed to “ended”.

When the new screen is rendered, no other touch events work. This is because the last touch event and object were removed from the screen, but never cleared from focus.

In between screens or before clearing the screen, try adding:
[lua]display.getCurrentStage():setFocus( nil ) [/lua]

This will clear the focused item and allow the new items to receive focus.

[import]uid: 11922 topic_id: 5888 reply_id: 34454[/import]