ensure valid client layers in client stack iterating functions

CIDs 1155288, 1155280
This commit is contained in:
Mike Blumenkrantz 2014-03-13 10:26:40 -04:00
parent 08acb0c6aa
commit 1abc612569
1 changed files with 2 additions and 0 deletions

View File

@ -2887,6 +2887,7 @@ e_client_above_get(const E_Client *ec)
return ec2;
}
if (ec->layer == E_LAYER_CLIENT_PRIO) return NULL;
if (e_comp_canvas_client_layer_map(ec->layer) == 9999) return NULL;
/* go up the layers until we find one */
for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_PRIO); x++)
@ -2920,6 +2921,7 @@ e_client_below_get(const E_Client *ec)
}
}
if (ec->layer == E_LAYER_CLIENT_DESKTOP) return NULL;
if (e_comp_canvas_client_layer_map(ec->layer) == 9999) return NULL;
/* go down the layers until we find one */
for (x = e_comp_canvas_layer_map(ec->layer) - 1; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)