input: set the focus to NULL when the focus's resource is destroyed

with the surface ref-count feature a surface may live on after its
resource was destroyed. so listen for the resource destroy signal
and set the focus to NULL.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
diff --git a/src/compositor.h b/src/compositor.h
index b84289a..526f3d1 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -308,7 +308,8 @@
 	struct wl_list focus_resource_list;
 	struct weston_view *focus;
 	uint32_t focus_serial;
-	struct wl_listener focus_listener;
+	struct wl_listener focus_view_listener;
+	struct wl_listener focus_resource_listener;
 	struct wl_signal focus_signal;
 	struct wl_signal motion_signal;
 
@@ -334,6 +335,8 @@
 	struct wl_list resource_list;
 	struct wl_list focus_resource_list;
 	struct weston_view *focus;
+	struct wl_listener focus_view_listener;
+	struct wl_listener focus_resource_listener;
 	uint32_t focus_serial;
 	struct wl_signal focus_signal;
 
@@ -435,6 +438,7 @@
 	struct wl_list resource_list;
 	struct wl_list focus_resource_list;
 	struct weston_surface *focus;
+	struct wl_listener focus_resource_listener;
 	uint32_t focus_serial;
 	struct wl_signal focus_signal;