Reset focus on unknown seats when restoring focus state
authorNeil Roberts <neil@linux.intel.com>
Wed, 9 Apr 2014 15:33:31 +0000 (16:33 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 10 Apr 2014 16:32:09 +0000 (09:32 -0700)
commit4237f50e11826445319864518289ba1733e11223
tree7f08754de4f11d278ce48d4578be1fdbd3fe68ad
parente5a1aee694e9256d88326e73a270268ab708c329
Reset focus on unknown seats when restoring focus state

The focus_state list on a workspace only contains entries for seats
which have a keyboard focus on that workspace. For workspaces that
have no surfaces the list will be empty. That means that when a
workspace with no surfaces is switched to it would previously leave
the keyboard focus unaffected and you could still type in the surface
on the old workspace.

This patch makes it instead reset the keyboard focus to NULL for seats
without a focus_state. It does this by temporarily stealing the
compositor's list of seats while it iterates the focus_states. After
all of the focus states have been processed any seats remaining in
this temporary list have their focus reset.

https://bugs.freedesktop.org/show_bug.cgi?id=73905
desktop-shell/shell.c