andreasgal/gaia — pull request #665 by davidflanagan (2012-02-25 00:14:39+00:00)
Title: long press on home button always brings up task switcher

This pull request, along with the gecko patch https://bugzilla.mozilla.org/show_bug.cgi?id=730434 addresses https://github.com/andreasgal/gaia/issues/642

The gecko patch in bugzilla edits b2g/chrome/content/shell.js so that it sends a 'home' event on a short press and release of the home button, but sends a new 'switcher' event on a long (1 second) press and hold of the home button.

This pull request edits apps/homescreen/js/window_mananger.js to respond to that new 'switcher' event. It also removes some event handling code in task_manager.js that is no longer necessary with this new scheme.

What this means is that you can now bring up the task switcher even when an app is displayed. You don't have to go to the homescreen first.

Note, however, that this was much tricker to do than I thought. There were a few places in window_mananger.js which implicitly assumed that if tasks were being switched there was no current window and we were at the homescreen.

The event handling logic of the homescreen is really complicated because there are so many moving part. Post demo it needs a re-write, or at least some good documentation, because it is hard to figure out...

So this pull request needs a careful review and careful testing if it is going to be pulled before the demo