double period;
guint periodic_timer;
bool pending_update;
+ char *pending_content;
void *user_data;
} widget_base_instance_data;
data = appcore_multiwindow_base_instance_get_extra(instance_h);
appcore_multiwindow_base_instance_drop(instance_h);
+ free(data->pending_content);
free(data->content);
free(data->id);
free(data);
bundle_free(content);
}
+static void __update_pending_content(
+ appcore_multiwindow_base_instance_h instance_h,
+ const char *content_raw)
+{
+ widget_base_instance_data *data;
+
+ data = (widget_base_instance_data *)
+ appcore_multiwindow_base_instance_get_extra(instance_h);
+
+ if (data->pending_content) {
+ free(data->pending_content);
+ data->pending_content = NULL;
+ }
+
+ if (content_raw) {
+ data->pending_content = strdup(content_raw);
+ if (data->pending_content == NULL)
+ LOGW("Out of memory");
+ }
+
+ data->pending_update = true;
+}
+
static void __update_process(const char *class_id, const char *id,
appcore_multiwindow_base_instance_h instance_h, void *data)
{
force = 0;
bundle_get_str(b, WIDGET_K_CONTENT_INFO, &content_raw);
- __call_update_cb(class_id, id, force, content_raw);
+ if (!appcore_multiwindow_base_instance_is_resumed(instance_h) && !force)
+ __update_pending_content(instance_h, content_raw);
+ else
+ __call_update_cb(class_id, id, force, content_raw);
}
static void __control_update(const char *class_id, const char *id, bundle *b)
/* call stub terminate */
appcore_multiwindow_base_instance_exit(instance_h);
+ free(data->pending_content);
free(data->content);
free(data->id);
free(data);
if (data->pending_update) {
LOGD("pending update!");
data->pending_update = false;
- __control_update(class_id, data->id, data->args);
+ __call_update_cb(class_id, data->id, 0, data->pending_content);
if (data->period > 0) {
LOGD("Restart timer!");
data->periodic_timer = g_timeout_add_seconds(