xwm: use always a valid 'primary view' for an X window
xwm: use always a valid 'primary view' for an X window

The xwm gets a primary view for a X window using the get_primary_view
vfunc of the shell_interface struct. Storing it is dangerous though
because it doesn't listen for its destruction so it may end up using the
old stored view pointer after that view was freed, or after the primary
view for that window was changed to another one.

Fetch the primary view just before using it every time and try to not
abuse this 'primary view' concept which may map badly to some shells:
iterate over all the views instead when it makes sense.

Tested-by: Benoit Gschwind <6d0fcc95e39ab8ccb88bafebb2075e9d5c92b713@gnu-log.net>
Reviewed-by: Derek Foreman <2f97e0f0bc172406aab8ccd42dab54c95bab8759@osg.samsung.com>
Reviewed-by: Bryce Harrington <bdb14cfc1ab8d24e13de84adc40b41ae60c13bd1@osg.samsung.com>

Fantu/compositor-spice,sir-murray/weston,Gnurou/weston,Gnurou/weston,Fantu/compositor-spice,kwm81/weston,krezovic/weston,giucam/weston,giucam/weston,kwm81/weston,sir-murray/weston,Fantu/compositor-spice,krezovic/weston