#include "fault.h"
#include "util.h"
+#define IS_LB_SHOWN(itm) (!(itm)->inst->item->has_livebox_script || ((itm)->inst->item->has_livebox_script && (itm)->is_lb_show))
+
int errno;
struct item {
* And handling this heavy updating from the
* file update callback.
*/
- if (interval >= MINIMUM_UPDATE_INTERVAL)
- item->monitor_cnt++;
- else
+ if (interval >= MINIMUM_UPDATE_INTERVAL) {
+ if (s_info.update == item) {
+ /*!
+ * \note
+ * If already in updating mode,
+ * reset the monitor_cnt to 1,
+ * all updated event will be merged into A inotify event
+ */
+ DbgPrint("While waiting updated event, content is updated [%s]\n", item->inst->id);
+ item->monitor_cnt = 1;
+ } else {
+ item->monitor_cnt++;
+ }
+ } else {
item->heavy_updating = 1;
+ }
item->update_interval = now;
}
item->monitor_cnt = 0;
}
+ DbgPrint("Monitor cnt(%s): %d\n", item->inst->id, item->monitor_cnt);
if (item->monitor_cnt == 0) {
if (!invalid)
fault_unmark_call(item->inst->item->pkgname, item->inst->id, "update,crashed", NO_ALARM);
return EXIT_SUCCESS; /*!< To keep the callback */
}
- if (!item->inst->item->has_livebox_script || (item->inst->item->has_livebox_script && item->is_lb_show)) {
+ if (IS_LB_SHOWN(item)) {
provider_send_updated(item->inst->item->pkgname, item->inst->id,
item->inst->w, item->inst->h, item->inst->priority, content, title);
} else {
- DbgPrint("Livebox script is not ready yet\n");
item->is_lb_updated++;
+ DbgPrint("Livebox script is not ready yet [%d]\n", item->is_lb_updated);
}
return output_handler(item);
return ECORE_CALLBACK_RENEW;
}
+ if (!IS_LB_SHOWN(item)) {
+ DbgPrint("%s is not shown yet. delaying updates\n", item->inst->item->pkgname);
+ (void)append_pending_list(item);
+ return ECORE_CALLBACK_RENEW;
+ }
+
ret = so_is_updated(item->inst);
if (ret <= 0) {
if (so_need_to_destroy(item->inst) == NEED_TO_DESTROY) {