Reset focus on unknown seats when restoring focus state
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

xorgy/weston,Fantu/compositor-spice,Tarnyko/weston-xdg_surface_present,eyolfson/weston,sir-murray/weston,kwm81/weston,kwm81/weston,Tarnyko/weston-xdg_surface_present,Fantu/compositor-spice,giucam/weston,Fantu/compositor-spice,Gnurou/weston,udoprog/weston,Gnurou/weston,jonnylamb/weston,eyolfson/weston,udoprog/weston,giucam/weston,krezovic/weston,krezovic/weston,xorgy/weston,sir-murray/weston,mchalupa/weston,jonnylamb/weston,mchalupa/weston