rotation: enhanced log message for the rotation 65/115365/1
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Feb 2017 12:51:10 +0000 (21:51 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Feb 2017 12:51:10 +0000 (21:51 +0900)
Change-Id: I9af3713c1fa4d7a3678cb8626db306fdeb6839e4

src/rotation/e_mod_rotation_wl.c

index 89e4dc4..7a571b4 100644 (file)
@@ -356,9 +356,11 @@ _e_tizen_rotation_set_available_angles_cb(struct wl_client *client,
 
         if (tz_angle)
           {
-             EDBG(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app. mapped:%d", tz_angle, ec->first_mapped);
              serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
+             EDBG(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app. mapped:%d serial:%u",
+                  tz_angle, ec->first_mapped, serial);
+
              if (ec->first_mapped)
                {
                   rot->angle_change_done = EINA_FALSE;
@@ -433,9 +435,11 @@ _e_tizen_rotation_set_preferred_angle_cb(struct wl_client *client,
 
         if (tz_angle)
           {
-             EDBG(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app. mapped:%d", tz_angle, ec->first_mapped);
              serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
+             EDBG(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app. mapped:%d serial:%u",
+                  tz_angle, ec->first_mapped, serial);
+
              if (ec->first_mapped)
                {
                   rot->angle_change_done = EINA_FALSE;
@@ -471,8 +475,20 @@ _e_tizen_rotation_ack_angle_change_cb(struct wl_client *client,
    if (!ec)
      return;
 
+   EDBG(ec, "Rotation Done: prev %d cur %d serial %u",
+        ec->e.state.rot.ang.curr,
+        TIZEN_ROTATION_ANGLE_TO_INT(rot->cur_angle),
+        serial);
+
    if (rot->serial == serial) // rotation success
      {
+        if (rot->angle_change_done)
+          {
+             WRN("Rotation Zone Set: Rotation Done(fail case): %s(%p) Already received change_done for this serial:%u",
+                 ec->icccm.name ? ec->icccm.name : "", ec, serial);
+             return;
+          }
+
         ec->e.state.rot.ang.prev = ec->e.state.rot.ang.curr;
         ec->e.state.rot.ang.curr = TIZEN_ROTATION_ANGLE_TO_INT(rot->cur_angle);
 
@@ -498,8 +514,9 @@ _e_tizen_rotation_ack_angle_change_cb(struct wl_client *client,
      }
    else // rotation fail
      {
-        WRN("Rotation Zone Set: Rotation Done(fail case): %s(%p)",
-            ec->icccm.name?:"", ec);
+        WRN("Rotation Zone Set: Rotation Done(fail case): %s(%p) Not matched serial %u != %u",
+            ec->icccm.name ? ec->icccm.name : "", ec, rot->serial, serial);
+
         _e_client_rotation_zone_set(ec->zone, ec, NULL);
      }
 
@@ -691,15 +708,25 @@ _e_tizen_rotation_send_angle_change(E_Client *ec, int angle)
    rot->cur_angle = tz_angle;
    rot->serial = serial;
 
-   EDBG(ec, "Send Change Rotation: angle %d", angle);
    EINA_LIST_FOREACH(rot->rotation_list, l, resource)
      {
         ver = wl_resource_get_version(resource); // resource is type of tizen_rotation_interface
+
         if ((ver >= 2) &&
             ((ec->floating) || (e_policy_client_is_keyboard_magnifier(ec))))
-          tizen_rotation_send_angle_change_with_resize(resource, tz_angle, serial, ec->h, ec->w);
+          {
+             EDBG(ec, "Send Change Rotation: angle %d mapped:%d serial:%u Resize:%dx%d -> %dx%d",
+                  tz_angle, ec->first_mapped, serial, ec->w, ec->h, ec->h, ec->w);
+
+             tizen_rotation_send_angle_change_with_resize(resource, tz_angle, serial, ec->h, ec->w);
+          }
         else
-          tizen_rotation_send_angle_change(resource, tz_angle, serial);
+          {
+             EDBG(ec, "Send Change Rotation: angle %d mapped:%d serial:%u",
+                  tz_angle, ec->first_mapped, serial);
+
+             tizen_rotation_send_angle_change(resource, tz_angle, serial);
+          }
      }
 }
 
@@ -817,6 +844,9 @@ _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclud
           }
         else
           {
+             ELOGF("ROTATION", "   bg_ec:%p CHECK %s(%p) parent:%p vis:%d",
+                   NULL, NULL, bg_ec, ec->icccm.name, ec, ec->parent,
+                   ec->visibility.obscured);
              /* if already found background client,
               * that means this client is placed under background client */
              if (bg_ec)
@@ -958,7 +988,10 @@ do_rotate:
    EINA_LIST_FOREACH(rot.force_update_list, l, ec)
      {
         if (!eina_list_data_find(target_list, ec))
-          target_list = eina_list_append(target_list, ec);
+          {
+             EDBG(ec, "Append Rotation List from force_update_list '%s'(%p)", ec->icccm.name, ec);
+             target_list = eina_list_append(target_list, ec);
+          }
      }
 
    EINA_LIST_FOREACH(target_list, l, ec)
@@ -1024,9 +1057,16 @@ _e_client_rotation_change_done(void)
 }
 
 static Eina_Bool
-_e_client_rotation_change_done_timeout(void *data __UNUSED__)
+_e_client_rotation_change_done_timeout(void *data)
 {
-   WRN("Timeout ROTATION_DONE");
+   E_Client *ec = (E_Client *)data;
+
+   if ((ec) && (!e_object_is_del(E_OBJECT(ec))))
+     WRN("Timeout ROTATION_DONE %s(%p)",
+         ec->icccm.name ? ec->icccm.name : "", ec);
+   else
+     WRN("Timeout ROTATION_DONE (%p)", ec);
+
    _e_client_rotation_change_done();
    return ECORE_CALLBACK_CANCEL;
 }
@@ -1396,6 +1436,10 @@ e_client_rotation_set(E_Client *ec, int rotation)
         // the window which type is "E_WINDOW_TYPE_NORMAL" will be rotated itself.
         // it shouldn't be rotated by rotation state of parent window.
         if (child->netwm.type == E_WINDOW_TYPE_NORMAL) continue;
+
+        ELOGF("ROTATION", "Do rotation of child win %s(%p)",
+              NULL, NULL, child->icccm.name, child);
+
         if (e_client_rotation_set(child, rotation))
           {
              ;
@@ -1451,7 +1495,7 @@ e_client_rotation_change_request(E_Client *ec, int rotation)
           ecore_timer_del(rot.done_timer);
         rot.done_timer = ecore_timer_add(4.0f,
                                          _e_client_rotation_change_done_timeout,
-                                         NULL);
+                                         ec);
      }
 }
 
@@ -1482,6 +1526,9 @@ _e_zone_rotation_set_internal(E_Zone *zone, int rot)
        (zone->rot.act == rot))
      return;
 
+   ELOGF("ROTATION", "ZONE_ROT |wait_for_done:%d->1",
+         NULL, NULL, zone->rot.wait_for_done);
+
    zone->rot.prev = zone->rot.act;
    zone->rot.curr = rot;
    zone->rot.wait_for_done = EINA_TRUE;
@@ -1672,6 +1719,9 @@ e_zone_rotation_block_set(E_Zone *zone, const char *name_hint, Eina_Bool block)
                   return EINA_TRUE;
                }
 
+             ELOGF("ROTATION", "ZONE_ROT |wait_for_done:%d->1",
+                   NULL, NULL, zone->rot.wait_for_done);
+
              zone->rot.prev = zone->rot.curr;
              zone->rot.curr = zone->rot.next;
              zone->rot.wait_for_done = EINA_TRUE;
@@ -1714,12 +1764,18 @@ e_zone_rotation_update_done(E_Zone *zone)
                         ev, _e_zone_event_rotation_change_end_free, NULL);
      }
 
+   ELOGF("ROTATION", "ZONE_ROT |wait_for_done:%d->0",
+         NULL, NULL, zone->rot.wait_for_done);
+
    zone->rot.wait_for_done = EINA_FALSE;
    if ((zone->rot.block.mod_count == 0) && (zone->rot.pending))
      {
         zone->rot.pending = EINA_FALSE;
         if (zone->rot.curr != zone->rot.next)
           {
+             ELOGF("ROTATION", "ZONE_ROT |wait_for_done:%d->1",
+                   NULL, NULL, zone->rot.wait_for_done);
+
              zone->rot.prev = zone->rot.curr;
              zone->rot.curr = zone->rot.next;
              zone->rot.wait_for_done = EINA_TRUE;
@@ -1750,6 +1806,9 @@ e_zone_rotation_update_cancel(E_Zone *zone)
    E_OBJECT_CHECK(zone);
    E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
 
+   ELOGF("ROTATION", "ZONE_ROT |wait_for_done:%d->0",
+         NULL, NULL, zone->rot.wait_for_done);
+
    zone->rot.wait_for_done = EINA_FALSE;
    if (zone->rot.pending)
      {