EDBG(ec, "Update Foreground Client '%s'(%p)", ec->icccm.name, ec);
if (e_policy_visibility_client_is_activity(ec))
- fg_ec = ec;
+ {
+ EDBG(ec, "Set the fg_ec to %x", e_client_util_win_get(ec));
+ fg_ec = ec;
+ }
_e_client_rotation_zone_set(ec->zone, ec, NULL);
if (ec->changes.rotation)
return ec->e.state.rot.ang.next;
}
+static E_Client *
+e_client_rotation_find_below(const E_Client *ec)
+{
+ unsigned int x;
+ E_Client *ec2;
+ Eina_Inlist *l;
+
+ E_OBJECT_CHECK_RETURN(ec, NULL);
+ E_OBJECT_TYPE_CHECK_RETURN(ec, E_CLIENT_TYPE, NULL);
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
+ if (EINA_INLIST_GET(ec)->prev) //check current layer
+ {
+ for (l = EINA_INLIST_GET(ec)->prev; l; l = l->prev)
+ {
+ ec2 = EINA_INLIST_CONTAINER_GET(l, E_Client);
+
+ if ((ec2->comp_data && ec2->comp_data->mapped) &&
+ (!e_object_is_del(E_OBJECT(ec2))) &&
+ (!e_client_util_ignored_get(ec2)) &&
+ (!ec2->exp_iconify.by_client))
+ return ec2;
+ }
+ }
+
+ /* go down the layers until we find one */
+ if (e_comp_canvas_layer_map(ec->layer) > e_comp_canvas_layer_map(E_LAYER_MAX)) return NULL;
+ x = e_comp_canvas_layer_map(ec->layer);
+ if (x > 0) x--;
+
+ for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
+ {
+ if (!e_comp->layers[x].clients) continue;
+ EINA_INLIST_REVERSE_FOREACH(e_comp->layers[x].clients, ec2)
+ {
+ if (ec2 == ec) continue;
+ if ((ec2->comp_data && ec2->comp_data->mapped) &&
+ (!e_object_is_del(E_OBJECT(ec2))) &&
+ (!e_client_util_ignored_get(ec2)) &&
+ (!ec2->exp_iconify.by_client))
+ return ec2;
+ }
+ }
+ return NULL;
+}
+
/**
* @describe
* Check if this e_client is rotatable to given angle.
{
Eina_Bool ret = EINA_FALSE;
unsigned int i;
+ E_Client *below = NULL;
+ Eina_Bool below_rot = EINA_TRUE;
if (ang < 0) return EINA_FALSE;
if (!ec->e.state.rot.support)
goto no_hint;
+ if (ec->e.state.rot.type == E_CLIENT_ROTATION_TYPE_DEPENDENT)
+ {
+ // check below fullsize window's angle
+ if ((ec->x == ec->zone->x) && (ec->y == ec->zone->y) &&
+ (ec->w == ec->zone->w) && (ec->h == ec->zone->h))
+ {
+ below = e_client_rotation_find_below(ec);
+ if (below)
+ {
+ below_rot = e_client_rotation_is_available(below, ang);
+ if (!below_rot)
+ {
+ EDBG(ec, "ec's below(ec:%p, win:%x) can not rotate to angle [%d]", below, e_client_util_win_get(below), ang);
+ goto no_hint;
+ }
+ }
+ }
+ }
+
if (ec->e.state.rot.preferred_rot == -1)
{
if (ec->e.state.rot.available_rots &&
}
if (fg_ec == ec)
- fg_ec = NULL;
+ {
+ EDBG(ec, "Set the fg_ec to NULL");
+ fg_ec = NULL;
+ }
}
static void
return EINA_FALSE;
if (e_policy_visibility_client_is_activity(ec))
- fg_ec = ec;
+ {
+ EDBG(ec, "Set the fg_ec to %x", e_client_util_win_get(ec));
+ fg_ec = ec;
+ }
_e_client_rotation_zone_set(ec->zone, ec, NULL);
if (ec->changes.rotation)
ec->e.state.rot.pending_show = 0;
if (fg_ec == ec)
- fg_ec = NULL;
+ {
+ EDBG(ec, "Set the fg_ec to NULL");
+ fg_ec = NULL;
+ }
// for rotating ec in the force_update_list
_e_client_rotation_zone_set(ec->zone, fg_ec, ec);