[client] Stack according to client on all screens

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-09 17:33:47 +02:00
parent 5575d719bd
commit ffec807e9d
1 changed files with 51 additions and 25 deletions

View File

@ -106,6 +106,52 @@ client_isprotodel(xcb_connection_t *c, xcb_window_t win)
return ret;
}
/** Returns true if a client is tagged
* with one of the tags in any screen.
* \return true or false
*/
static bool
client_isvisible_anyscreen(Client *c)
{
Tag *tag;
int screen;
if(!c)
return false;
if(globalconf.scratch.client == c)
return globalconf.scratch.isvisible;
for(screen = 0; screen < globalconf.screens_info->nscreen; screen++)
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
if(tag->selected && is_client_tagged(c, tag))
return true;
return false;
}
/** Returns true if a client is tagged
* with one of the tags.
* \param c the client
* \param screen number
* \return true or false
*/
bool
client_isvisible(Client *c, int screen)
{
Tag *tag;
if(!c || c->screen != screen)
return false;
if(globalconf.scratch.client == c)
return globalconf.scratch.isvisible;
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
if(tag->selected && is_client_tagged(c, tag))
return true;
return false;
}
/** Get a Client by its window
* \param list Client list to look info
* \param w Client window to find
@ -248,17 +294,18 @@ client_stack(Client *c)
{
uint32_t config_win_vals[2];
Client *client;
unsigned int layer;
Layer maxlayer = LAYER_FULLSCREEN;
Layer layer;
config_win_vals[0] = XCB_NONE;
config_win_vals[1] = XCB_STACK_MODE_ABOVE;
for(layer = 0; layer < maxlayer; layer++)
for(layer = LAYER_DESKTOP; layer < LAYER_FULLSCREEN; layer++)
{
/* \todo we need to maintain a separate stack list */
for(client = globalconf.clients; client; client = client->next)
{
if(client->layer == layer && client != c && client_isvisible(client, c->screen))
if(client->layer == layer && client != c
&& client_isvisible_anyscreen(client))
{
if(client->titlebar.position && client->titlebar.sw)
{
@ -756,27 +803,6 @@ client_updatesizehints(Client *c)
return size;
}
/** Returns true if a client is tagged
* with one of the tags
* \return true or false
*/
bool
client_isvisible(Client *c, int screen)
{
Tag *tag;
if(!c || c->screen != screen)
return false;
if(globalconf.scratch.client == c)
return globalconf.scratch.isvisible;
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
if(tag->selected && is_client_tagged(c, tag))
return true;
return false;
}
/** Set the transparency of the selected client.
* Argument should be an absolut or relativ floating between 0.0 and 1.0
* \param screen Screen ID