E_Client *ec, *bg_ec = NULL;
Eina_List *target_list = NULL, *l;
int i, angle;
+ int cur_angle;
Eina_Bool can_rotate = EINA_TRUE, ret = EINA_FALSE;
TRACE_DS_BEGIN(CLIENT ROTATION ZONE SET);
DBG("<<< Try to set zone rotation");
+
+ if (zone->rot.unknown_state)
+ cur_angle = zone->rot.act;
+ else
+ cur_angle = zone->rot.curr;
+
E_CLIENT_REVERSE_FOREACH(ec)
{
if (ec->zone != zone) continue;
if ((ec->comp_data) && (ec->comp_data->sub.data)) continue;
if (!e_util_strcmp("wl_pointer-cursor", ec->icccm.window_role))
{
- e_client_cursor_map_apply(ec, zone->rot.curr, ec->x, ec->y);
+ e_client_cursor_map_apply(ec, cur_angle, ec->x, ec->y);
continue;
}
}
else
{
- e_client_rotation_set(ec, zone->rot.curr);
+ e_client_rotation_set(ec, cur_angle);
continue;
}
* rotation is enabled.
*/
if ((!zone->rot.block.sys_auto_rot) &&
- (e_mod_pol_conf_rot_enable_get(zone->rot.curr)))
- e_client_rotation_set(ec, zone->rot.curr);
+ (e_mod_pol_conf_rot_enable_get(cur_angle)))
+ e_client_rotation_set(ec, cur_angle);
}
continue;
}
/* TODO: Fix me. To prevent rotation of 180 degrees for normal app */
if ((!_camera_check(ec)) &&
- (!e_mod_pol_conf_rot_enable_get(zone->rot.curr)))
+ (!e_mod_pol_conf_rot_enable_get(cur_angle)))
continue;
EDBG(ec, "Append Rotation List '%s'(%p)", ec->icccm.name, ec);
}
}
- angle = zone->rot.curr;
+ angle = cur_angle;
EINA_LIST_FOREACH(target_list, l, ec)
{
if (!e_client_rotation_is_available(ec, angle))
{
for (i = 0; i < 360; i += 90)
{
- if ((i == zone->rot.curr) || (i == angle))
+ if ((i == cur_angle) || (i == angle))
continue;
can_rotate = EINA_TRUE;
if (target_list)
eina_list_free(target_list);
+ zone->rot.act = angle;
+
TRACE_DS_END();
+ ELOGF("ROTATION", "zone active angle %d", NULL, NULL, zone->rot.act);
DBG("End to set zone rotation: %s >>>", ret ? "Change" : "Stay");
return ret;
}
if (!e_config->wm_win_rotation) return;
- ELOGF("ROTATION", "ZONE_ROT |zone:%d|rot curr:%d, rot:%d",
- NULL, NULL, zone->num, zone->rot.curr, rot);
+ ELOGF("ROTATION", "ZONE_ROT |zone:%d|rot curr:%d, active:%d, rot:%d",
+ NULL, NULL, zone->num, zone->rot.curr, zone->rot.act, rot);
- if (zone->rot.curr == rot) return;
+ if ((zone->rot.curr == rot) &&
+ (zone->rot.act == rot))
+ return;
- zone->rot.prev = zone->rot.curr;
+ zone->rot.prev = zone->rot.act;
zone->rot.curr = rot;
zone->rot.wait_for_done = EINA_TRUE;