From: Duna Oh Date: Tue, 28 Feb 2017 09:16:13 +0000 (+0900) Subject: indicator: set indicator's angle when rotation begins X-Git-Tag: submit/tizen_3.0/20170413.101747^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4743c5c002aa56fe5d1e4c1ccdcad8846cbee403;p=platform%2Fupstream%2Fenlightenment.git indicator: set indicator's angle when rotation begins It solves the issue that wrong sized indicator is shown for a while when rotation ends. This patch is related with following patch. https://review.tizen.org/gerrit/#/c/119081 Signed-off-by: Duna Oh Change-Id: I618e6be95145bbe89e8bf164c229ba65862aa861 --- diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 85c48a6e12..7bbdb82286 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -4018,10 +4018,9 @@ _e_tzsh_indicator_find_topvisible_client(E_Zone *zone) return NULL; } -static void -_e_tzsh_indicator_srv_property_change_send(E_Client *ec) +EINTERN void +e_tzsh_indicator_srv_property_change_send(E_Client *ec, int angle) { - int angle; int opacity; if (!ec) return; @@ -4031,7 +4030,6 @@ _e_tzsh_indicator_srv_property_change_send(E_Client *ec) return; } - angle = ec->e.state.rot.ang.curr; opacity = ec->indicator.opacity_mode; ELOGF("TZ_IND", "SEND indicator info. angle:%d, opacity:%d", ec->pixmap, ec, angle, opacity); @@ -4047,7 +4045,10 @@ e_tzsh_indicator_srv_property_update(E_Client *ec) ec_ind_owner = e_mod_indicator_owner_get(); if (ec != ec_ind_owner) return; - _e_tzsh_indicator_srv_property_change_send(ec); + if (ec->e.state.rot.ang.next != -1) + e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next); + else + e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr); } EINTERN void @@ -4069,7 +4070,11 @@ e_tzsh_indicator_srv_ower_win_update(E_Zone *zone) e_mod_indicator_owner_set(ec); if (ec && !ec->e.state.rot.pending_show) - e_tzsh_indicator_srv_property_update(ec); + { + ELOGF("TZ_IND", "Property Update. name:%s curr:%d, next:%d", NULL, NULL, ec->icccm.name?:"NULL", + ec->e.state.rot.ang.curr, ec->e.state.rot.ang.next); + e_tzsh_indicator_srv_property_update(ec); + } } } @@ -6144,8 +6149,7 @@ _tz_indicator_cb_opacity_mode_set(struct wl_client *client EINA_UNUSED, struct w if (ec->indicator.opacity_mode == op_mode) return; ec->indicator.opacity_mode = op_mode; - if (ec == e_mod_indicator_owner_get()) - _e_tzsh_indicator_srv_property_change_send(ec); + e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr); e_policy_event_simple(ec, E_EVENT_POLICY_INDICATOR_OPACITY_MODE_CHANGE); } diff --git a/src/bin/e_policy_wl.h b/src/bin/e_policy_wl.h index 629e080070..beda40c705 100644 --- a/src/bin/e_policy_wl.h +++ b/src/bin/e_policy_wl.h @@ -43,6 +43,7 @@ E_API void e_tzsh_qp_state_orientation_update(E_Client *ec, int ridx); E_API void e_tzsh_qp_state_scrollable_update(E_Client *ec, Eina_Bool scrollable); /* tzsh indicator */ +EINTERN void e_tzsh_indicator_srv_property_change_send(E_Client *ec, int angle); EINTERN void e_tzsh_indicator_srv_property_update(E_Client *ec); EINTERN void e_tzsh_indicator_srv_ower_win_update(E_Zone *zone); diff --git a/src/bin/services/e_service_indicator.c b/src/bin/services/e_service_indicator.c index 1cfbbc8901..67a0d431e6 100644 --- a/src/bin/services/e_service_indicator.c +++ b/src/bin/services/e_service_indicator.c @@ -8,6 +8,30 @@ static E_Client *_ind_owner = NULL; /* event handler */ static Eina_List *_ind_handlers = NULL; static Eina_List *_ind_hooks = NULL; +static int _ind_angle = -1; + +static Eina_Bool +_indicator_cb_rot_begin(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Client *ec = NULL; + E_Event_Client_Rotation_Change_Begin *ev = NULL; + + ev = event; + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); + + ec = ev->ec; + if (ec == _ind_owner) + { + if (ec->e.state.rot.ang.next != -1) + { + ELOGF("TZ_IND", "Rotation begins.(ec:%s) Set indicator's angle to next angle:%d", ec->pixmap, ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.next); + _ind_angle = ec->e.state.rot.ang.next; + e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.next); + } + } + + return ECORE_CALLBACK_PASS_ON; +} static Eina_Bool _indicator_cb_rot_done(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) @@ -21,7 +45,12 @@ _indicator_cb_rot_done(void *data EINA_UNUSED, int type EINA_UNUSED, void *event ec = ev->ec; if (ec == _ind_owner) { - e_tzsh_indicator_srv_property_update(ec); + if (_ind_angle != ec->e.state.rot.ang.curr) + { + ELOGF("TZ_IND", "Rotation is done.(ec:%s) Set indicator's angle to curr angle:%d", ec->pixmap, ec, ec->icccm.name?:"NULL", ec->e.state.rot.ang.curr); + _ind_angle = ec->e.state.rot.ang.curr; + e_tzsh_indicator_srv_property_change_send(ec, ec->e.state.rot.ang.curr); + } } return ECORE_CALLBACK_PASS_ON; @@ -73,6 +102,8 @@ e_mod_indicator_client_set(E_Client *ec) e_client_window_role_set(ec, "indicator"); + E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_BEGIN, _indicator_cb_rot_begin, NULL); + E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_CANCEL, _indicator_cb_rot_done, NULL); E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_END, _indicator_cb_rot_done, NULL); E_LIST_HOOK_APPEND(_ind_hooks, E_CLIENT_HOOK_DEL, _indicator_cb_client_del, NULL);