indicator: set indicator's angle when rotation begins 03/116803/6 accepted/tizen/3.0/common/20170414.094900 accepted/tizen/3.0/ivi/20170414.043103 accepted/tizen/3.0/mobile/20170414.042925 accepted/tizen/3.0/tv/20170414.043002 accepted/tizen/3.0/wearable/20170414.043040 submit/tizen_3.0/20170413.101747
authorDuna Oh <duna.oh@samsung.com>
Tue, 28 Feb 2017 09:16:13 +0000 (18:16 +0900)
committerDuna Oh <duna.oh@samsung.com>
Thu, 13 Apr 2017 08:07:21 +0000 (17:07 +0900)
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 <duna.oh@samsung.com>
Change-Id: I618e6be95145bbe89e8bf164c229ba65862aa861

src/bin/e_policy_wl.c
src/bin/e_policy_wl.h
src/bin/services/e_service_indicator.c

index 85c48a6..7bbdb82 100644 (file)
@@ -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);
 }
index 629e080..beda40c 100644 (file)
@@ -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);
 
index 1cfbbc8..67a0d43 100644 (file)
@@ -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);