rotation: added code to check visibility of given ec before setting rotation in _e_cl... 76/115376/1
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Feb 2017 13:03:32 +0000 (22:03 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 17 Feb 2017 13:03:32 +0000 (22:03 +0900)
we need to check ec is visible before rotating it.

e.g. camera -> image-viewer launching case

  image-viewer: bg_ec is set to image-viewer ec at the previous phase of this loop
  ec: camera

  if we decide to rotate camera ec which is obscured by image-viewer window,
  then camera app will not send rotation done event. thus it occurrs rotation time
  out error. to resolve this issue we should exclude obscured camera ec from
  rotation list.

Change-Id: Icd531284f6a894fea61d2e4f283a858c8ca69d83

src/rotation/e_mod_rotation_wl.c

index 7a571b4..875a9f2 100644 (file)
@@ -854,7 +854,7 @@ _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclud
                   /* if this client don't have parent, rotate */
                   if (!ec->parent)
                     {
-                       /* rotate window only if auto-rotation is enabled.
+                       /* 1. rotate window only if auto-rotation is enabled.
                         * it can show wrong rotated window if we don't check auto-rot value.
                         *
                         * assuming that auto-rotation is disabled and window A is 0 degree.
@@ -862,10 +862,28 @@ _e_client_rotation_zone_set(E_Zone *zone, E_Client *include_ec, E_Client *exclud
                         * always rotated, window A is changed to 270 degrees before showing
                         * camera-app window. to prevent this we should check whether auto
                         * rotation is enabled.
+                        *
+                        * 2. also need to check this ec is visible before rotating it.
+                        *
+                        * e.g. camera -> image-viewer launching case
+                        *
+                        *  image-viewer: bg_ec is set to image-viewer ec at the previous phase of this loop
+                        *  ec: camera
+                        *
+                        *  if we decide to rotate camera ec which is obscured by image-viewer window,
+                        *  then camera app will not send rotation done event. thus it occurrs rotation time
+                        *  out error. to resolve this issue we should exclude obscured camera ec from
+                        *  rotation list.
                         */
                        if ((!zone->rot.block.sys_auto_rot) &&
-                           (e_mod_pol_conf_rot_enable_get(cur_angle)))
-                         e_client_rotation_set(ec, cur_angle);
+                           (e_mod_pol_conf_rot_enable_get(cur_angle)) &&
+                           (ec->visibility.obscured != E_VISIBILITY_FULLY_OBSCURED))
+                         {
+                            ELOGF("ROTATION", "Do rotation of below ec under bg_ec %s(%p)",
+                                  NULL, NULL, ec->icccm.name, ec);
+
+                            e_client_rotation_set(ec, cur_angle);
+                         }
                     }
                   continue;
                }