input = wl_container_of(listener, input, top_change);
- input->top_view = view;
-
- if (input->top_view_destroy.notify)
+ if (input->top_view_destroy.notify) {
wl_list_remove(&input->top_view_destroy.link);
- else
+ input->top_view_destroy.notify = NULL;
+ }
+
+ if (view) {
input->top_view_destroy.notify = handle_top_view_destroy;
+ wl_signal_add(&view->events.destroy, &input->top_view_destroy);
+ }
- wl_signal_add(&view->events.destroy, &input->top_view_destroy);
+ input->top_view = view;
}
static void