{
E_Client *ec, *bg_ec = NULL;
Eina_List *target_list = NULL, *l, *ll;
- int i, angle;
- int cur_angle;
+ int angle, cur_angle, top_win_angle;
Eina_Bool can_rotate = EINA_TRUE, ret = EINA_FALSE;
TRACE_DS_BEGIN(CLIENT ROTATION ZONE SET);
else
cur_angle = zone->rot.curr;
+ top_win_angle = -1;
+
DBG("<<< Try to set zone rotation | fg_ec '%s'(%p) cur_angle:%d zone(unknown_state:%d act:%d curr:%d)",
fg_ec ? fg_ec->icccm.name : "",
fg_ec,
can_rotate = EINA_FALSE;
break;
}
+ else
+ {
+ if (top_win_angle == -1)
+ {
+ if (e_policy_client_is_keyboard(ec) ||
+ e_policy_client_is_keyboard_sub(ec))
+ continue;
+
+ EDBG(ec, "Set top_win_angle: %d", angle);
+ top_win_angle = angle;
+ }
+ }
}
if (!can_rotate)
can_rotate = EINA_FALSE;
break;
}
+ else
+ {
+ if (top_win_angle == -1)
+ {
+ if (e_policy_client_is_keyboard(ec) ||
+ e_policy_client_is_keyboard_sub(ec))
+ continue;
+
+ EDBG(ec, "Set top_win_angle: %d", angle);
+ top_win_angle = angle;
+ }
+ }
}
}
else
/* support more than one client with fixed angle value */
if (eina_list_count(target_list) > 0)
{
- Eina_Bool res, first_ec = EINA_TRUE;
- int zone_act_angle = angle, ang;
+ Eina_Bool res;
- EINA_LIST_FOREACH_SAFE(target_list, l, ll, ec)
+ if (top_win_angle == -1)
{
- for (i = 0; i < 4; i++)
- {
- /* start with given angle */
- ang = (angle + (i * 90)) % 360;
+ DBG("Set top_win_angle: %d", angle);
+ top_win_angle = cur_angle;
+ }
- EDBG(ec, "Attempt to rotate client with given angle %d", ang);
+ angle = top_win_angle;
- if (e_client_rotation_is_available(ec, ang))
- {
- res = e_client_rotation_set(ec, ang);
- if (!res) ret = EINA_FALSE;
-
- if (first_ec)
- {
- /* change angle of zone according to top most ec */
- EDBG(ec, "Change zoen angle %d -> %d", zone_act_angle, ang);
- zone_act_angle = ang;
- first_ec = EINA_FALSE;
- }
-
- target_list = eina_list_remove_list(target_list, l);
- break;
- }
- else
- {
- EDBG(ec, "Failed to set with exist client: not able to rotate given angle %d", ang);
- }
+ EINA_LIST_FOREACH_SAFE(target_list, l, ll, ec)
+ {
+ EDBG(ec, "Attempt to rotate client with given angle %d", top_win_angle);
+ if (e_client_rotation_is_available(ec, top_win_angle))
+ {
+ res = e_client_rotation_set(ec, top_win_angle);
+ if (!res) ret = EINA_FALSE;
+ }
+ else
+ {
+ EDBG(ec, "Failed to set given angle %d, Keep current angle %d", top_win_angle, ec->e.state.rot.ang.curr);
}
}
if (!eina_list_data_find(target_list, ec))
{
EDBG(ec, "Rotate ec of force_update_list '%s'(%p)", ec->icccm.name, ec);
- res = e_client_rotation_set(ec, zone_act_angle);
+ res = e_client_rotation_set(ec, top_win_angle);
if (!res) ret = EINA_FALSE;
}
}