X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fclient.c;h=db76c06456683ebd5224bed85cf063b9ee289cc3;hb=e74ddc0aafa37e7e12ef4c3e9695ea438d4026d1;hp=265189d7f86e0dd56bf8e7e8dfb918a8ae3cd560;hpb=ee66d255c33d3cb90a739c3a848c5f6f3dda88a3;p=platform%2Fframework%2Fweb%2Flivebox-viewer.git diff --git a/src/client.c b/src/client.c index 265189d..db76c06 100644 --- a/src/client.c +++ b/src/client.c @@ -439,13 +439,21 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa int h; int is_pd; + if (!packet) { + ErrPrint("Invalid packet\n"); + ret = -EINVAL; + goto out; + } + ret = packet_get(packet, "ssiiii", &pkgname, &id, &is_pd, &w, &h, &status); if (ret != 6) { ErrPrint("Invalid argument\n"); - ret = EINVAL; + ret = -EINVAL; goto out; } + DbgPrint("Size is changed: %dx%d (%s)\n", w, h, id); + handler = lb_find_livebox(pkgname, id); if (!handler) { ErrPrint("Livebox(%s - %s) is not found\n", pkgname, id); @@ -454,11 +462,13 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa } if (handler->state != CREATE) { + ErrPrint("Hander is not created yet\n"); ret = -EPERM; goto out; } if (is_pd) { + DbgPrint("PD is resized\n"); /*! * \NOTE * PD is not able to resized by the client. @@ -466,20 +476,31 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa * So the PD has no private resized event handler. * Notify it via global event handler. */ - lb_invoke_event_handler(handler, LB_EVENT_PD_SIZE_CHANGED); - if (status != 0) + if (status == 0) { + lb_set_pdsize(handler, w, h); + lb_invoke_event_handler(handler, LB_EVENT_PD_SIZE_CHANGED); + } else { ErrPrint("This is not possible. PD Size is changed but the return value is not ZERO\n"); + } } else { - if (status == 0) + DbgPrint("LB is resized\n"); + if (status == 0) { + DbgPrint("Livebox size is updated (%dx%d)\n", w, h); lb_set_size(handler, w, h); - if (handler->size_changed_cb) { - handler->size_changed_cb(handler, status, handler->size_cbdata); + if (handler->size_changed_cb) { + DbgPrint("Call the size changed callback\n"); + handler->size_changed_cb(handler, status, handler->size_cbdata); - handler->size_changed_cb = NULL; - handler->size_cbdata = NULL; + handler->size_changed_cb = NULL; + handler->size_cbdata = NULL; + } else { + DbgPrint("Call the global size changed callback\n"); + lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED); + DbgPrint("Size changed callback done\n"); + } } else { - lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED); + DbgPrint("Livebox size is not changed: %dx%d, %d\n", w, h, status); } }