Fix method for determining focused window.

Method had been rewritten to be task-based and there were errors
when a task had no apptokens. New version is much easier to
maintain.

Maybe fixes bug 10689184.

Change-Id: I5e4c8447a33a4f5686296c20b9f9fe302c9ae49f
1 file changed