const char *id;
double timestamp;
struct livebox *handler;
+ int reason;
- if (packet_get(packet, "ssd", &pkgname, &id, ×tamp) != 3) {
+ if (packet_get(packet, "ssdi", &pkgname, &id, ×tamp, &reason) != 4) {
ErrPrint("Invalid arguemnt\n");
goto out;
}
/*!
* \note
*
- * "if (handler->id == NULL)"
+ * "if (handler->id == NULL) {"
*
* The instance is not created yet.
* But the master forcely destroy it and send destroyed event to this
* before creating an instance successfully.
*/
if (handler->created_cb == handler->deleted_cb) {
- if (handler->created_cbdata != handler->deleted_cbdata)
+ if (handler->created_cbdata != handler->deleted_cbdata) {
DbgPrint("cb is same but cbdata is different (%s - %s)\n", pkgname, id);
+ }
handler->deleted_cb = NULL;
handler->deleted_cbdata = NULL;
handler->created_cb = NULL;
handler->created_cbdata = NULL;
- cb(handler, LB_STATUS_ERROR_CANCEL, cbdata);
+ if (reason == LB_STATUS_SUCCESS) {
+ reason = LB_STATUS_ERROR_CANCEL;
+ }
+ cb(handler, reason, cbdata);
} else if (handler->id) {
if (handler->deleted_cb) {
ret_cb_t cb;
handler->deleted_cb = NULL;
handler->deleted_cbdata = NULL;
- cb(handler, LB_STATUS_SUCCESS, cbdata);
+ cb(handler, reason, cbdata);
} else {
lb_invoke_event_handler(handler, LB_EVENT_DELETED);
}
* And then begin updating again after change its size.
*/
if (lb_get_lb_fb(handler)) {
- lb_set_lb_fb(handler, fbfile);
+ (void)lb_set_lb_fb(handler, fbfile);
ret = fb_sync(lb_get_lb_fb(handler));
if (ret != LB_STATUS_SUCCESS) {
}
if (lb_get_pd_fb(handler)) {
- lb_set_lb_fb(handler, fbfile);
+ (void)lb_set_lb_fb(handler, fbfile);
ret = fb_sync(lb_get_lb_fb(handler));
if (ret != LB_STATUS_SUCCESS) {
const char *fbfile;
const char *content;
const char *title;
+ const char *safe_file;
struct livebox *handler;
int lb_w;
int lb_h;
double priority;
int ret;
- ret = packet_get(packet, "sssiidss",
+ ret = packet_get(packet, "sssiidsss",
&pkgname, &id,
&fbfile, &lb_w, &lb_h,
- &priority, &content, &title);
- if (ret != 8) {
+ &priority, &content, &title,
+ &safe_file);
+ if (ret != 9) {
ErrPrint("Invalid argument\n");
goto out;
}
lb_set_content(handler, content);
lb_set_title(handler, title);
lb_set_size(handler, lb_w, lb_h);
+ lb_set_filename(handler, safe_file);
if (lb_text_lb(handler)) {
(void)parse_desc(handler, livebox_filename(handler), 0);
*/
goto out;
} else if (lb_get_lb_fb(handler)) {
- lb_set_lb_fb(handler, fbfile);
- ret = fb_sync(lb_get_lb_fb(handler));
- if (ret != LB_STATUS_SUCCESS) {
- ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, util_basename(util_uri_to_path(id)), ret);
+ if (conf_frame_drop_for_resizing() && handler->size_changed_cb) {
+ /* Just for skipping the update event callback call, After request to resize buffer, update event will be discarded */
+ DbgPrint("Discards obsoloted update event\n");
+ ret = LB_STATUS_ERROR_BUSY;
+ } else {
+ (void)lb_set_lb_fb(handler, fbfile);
+
+ if (!conf_manual_sync()) {
+ ret = fb_sync(lb_get_lb_fb(handler));
+ if (ret != LB_STATUS_SUCCESS) {
+ ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, util_basename(util_uri_to_path(id)), ret);
+ }
+ } else {
+ ret = LB_STATUS_SUCCESS;
+ }
}
} else {
ret = LB_STATUS_SUCCESS;
if (lb_text_pd(handler)) {
(void)parse_desc(handler, descfile, 1);
} else {
- (void)lb_set_pd_fb(handler, fbfile);
-
- ret = fb_sync(lb_get_pd_fb(handler));
- if (ret < 0) {
- ErrPrint("Failed to do sync FB (%s - %s), %d\n", pkgname, util_basename(util_uri_to_path(id)), ret);
+ if (conf_frame_drop_for_resizing() && handler->size_changed_cb) {
+ /* Just for skipping the update event callback call, After request to resize buffer, update event will be discarded */
+ DbgPrint("Discards obsoloted update event\n");
} else {
- lb_invoke_event_handler(handler, LB_EVENT_PD_UPDATED);
+ (void)lb_set_pd_fb(handler, fbfile);
+
+ if (!conf_manual_sync()) {
+ ret = fb_sync(lb_get_pd_fb(handler));
+ if (ret < 0) {
+ ErrPrint("Failed to do sync FB (%s - %s), %d\n", pkgname, util_basename(util_uri_to_path(id)), ret);
+ } else {
+ lb_invoke_event_handler(handler, LB_EVENT_PD_UPDATED);
+ }
+ } else {
+ lb_invoke_event_handler(handler, LB_EVENT_PD_UPDATED);
+ }
}
}
* Update it too.
*/
if (lb_get_lb_fb(handler)) {
- lb_set_lb_fb(handler, fbfile);
+ (void)lb_set_lb_fb(handler, fbfile);
ret = fb_sync(lb_get_lb_fb(handler));
if (ret < 0) {
if (!strlen(lb_fname)) {
break;
}
- lb_set_lb_fb(handler, lb_fname);
+ (void)lb_set_lb_fb(handler, lb_fname);
+
ret = fb_sync(lb_get_lb_fb(handler));
if (ret < 0) {
ErrPrint("Failed to do sync FB (%s - %s)\n", pkgname, util_basename(util_uri_to_path(id)));
{
int state = 0;
- if (vconf_get_bool(VCONFKEY_MASTER_STARTED, &state) < 0)
+ if (vconf_get_bool(VCONFKEY_MASTER_STARTED, &state) < 0) {
ErrPrint("Unable to get [%s]\n", VCONFKEY_MASTER_STARTED);
+ }
DbgPrint("Master state: %d\n", state);
if (state == 1 && make_connection() == LB_STATUS_SUCCESS) {
static gboolean timeout_cb(gpointer data)
{
- if (vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL) < 0)
+ if (vconf_notify_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb, NULL) < 0) {
ErrPrint("Failed to add vconf for monitoring service state\n");
- else
+ } else {
DbgPrint("vconf event callback is registered\n");
+ }
master_started_cb(NULL, NULL);