h = calloc(1, sizeof *h);
TDM_RETURN_VAL_IF_FAIL(h != NULL, TDM_ERROR_OUT_OF_MEMORY);
+ if (LIST_IS_EMPTY(&private_output->change_handler_list))
+ wl_tdm_output_watch_output_changes(private_output->output, 1);
+
h->private_output = private_output;
h->func = func;
h->user_data = user_data;
LIST_DEL(&h->link);
free(h);
+
+ if (LIST_IS_EMPTY(&private_output->change_handler_list))
+ wl_tdm_output_watch_output_changes(private_output->output, 0);
+
return;
}
}