diff --git a/client.c b/client.c index feb65764e..da598a8f1 100644 --- a/client.c +++ b/client.c @@ -251,6 +251,7 @@ detach(Client * c) /** Give focus to client, or to first client if c is NULL * \param disp Display ref + * \param screen Screen number * \param drawcontext drawcontext ref * \param c client * \param selscreen True if current screen is selected @@ -260,8 +261,8 @@ void focus(Display *disp, int screen, DC *drawcontext, Client * c, Bool selscreen, awesome_config *awesomeconf) { /* if c is NULL or invisible, take next client in the stack */ - if((!c && selscreen) || (c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags))) - for(c = stack; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->snext); + if((!c && selscreen) || (c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags))) + for(c = stack; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->snext); /* if a client was selected but it's not the current client, unfocus it */ if(sel && sel != c) diff --git a/event.c b/event.c index de494fbf8..4c646d3ad 100644 --- a/event.c +++ b/event.c @@ -238,7 +238,7 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf __attribut c->y = DisplayHeight(c->display, c->screen) / 2 - c->h / 2; /* center in y direction */ if((ev->value_mask & (CWX | CWY)) && !(ev->value_mask & (CWWidth | CWHeight))) configure(c); - if(isvisible(c, awesomeconf[c->screen].selected_tags, awesomeconf[c->screen].ntags)) + if(isvisible(c, c->screen, awesomeconf[c->screen].selected_tags, awesomeconf[c->screen].ntags)) XMoveResizeWindow(e->xany.display, c->win, c->x, c->y, c->w, c->h); } else diff --git a/layout.c b/layout.c index 52133bbf6..9b23c4b7c 100644 --- a/layout.c +++ b/layout.c @@ -41,7 +41,7 @@ arrange(Display * disp, int screen, DC *drawcontext, awesome_config *awesomeconf { if(c->screen != screen) continue; - if(isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags)) + if(isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags)) unban(c); else ban(c); @@ -53,7 +53,7 @@ arrange(Display * disp, int screen, DC *drawcontext, awesome_config *awesomeconf void uicb_focusnext(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), + int screen, DC *drawcontext, awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) @@ -62,19 +62,19 @@ uicb_focusnext(Display *disp __attribute__ ((unused)), if(!sel) return; - for(c = sel->next; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); + for(c = sel->next; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); if(!c) - for(c = clients; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); + for(c = clients; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next); if(c) { - focus(c->display, c->screen, drawcontext, c, True, awesomeconf); - restack(c->display, c->screen, drawcontext, awesomeconf); + focus(c->display, screen, drawcontext, c, True, awesomeconf); + restack(c->display, screen, drawcontext, awesomeconf); } } void uicb_focusprev(Display *disp __attribute__ ((unused)), - int screen __attribute__ ((unused)), + int screen, DC *drawcontext, awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) @@ -83,16 +83,16 @@ uicb_focusprev(Display *disp __attribute__ ((unused)), if(!sel) return; - for(c = sel->prev; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); + for(c = sel->prev; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); if(!c) { for(c = clients; c && c->next; c = c->next); - for(; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); + for(; c && !isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags); c = c->prev); } if(c) { - focus(c->display, c->screen, drawcontext, c, True, awesomeconf); - restack(c->display, c->screen, drawcontext, awesomeconf); + focus(c->display, screen, drawcontext, c, True, awesomeconf); + restack(c->display, screen, drawcontext, awesomeconf); } } diff --git a/layouts/floating.c b/layouts/floating.c index 982f84013..7b2ae30a3 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -32,7 +32,7 @@ floating(Display *disp __attribute__ ((unused)), int screen, awesome_config *awe Client *c; for(c = clients; c; c = c->next) - if(isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags) && c->screen == screen) + if(isvisible(c, screen, awesomeconf->selected_tags, awesomeconf->ntags)) { if(c->ftview) { diff --git a/tag.c b/tag.c index 376521b0d..81452bfb7 100644 --- a/tag.c +++ b/tag.c @@ -127,12 +127,12 @@ compileregs(Rule * rules, int nrules) * \return True or False */ Bool -isvisible(Client * c, Bool * tags, int ntags) +isvisible(Client * c, int screen, Bool * tags, int ntags) { int i; for(i = 0; i < ntags; i++) - if(c->tags[i] && tags[i]) + if(c->tags[i] && tags[i] && c->screen == screen) return True; return False; } diff --git a/tag.h b/tag.h index 9d19888a2..34fa12ff5 100644 --- a/tag.h +++ b/tag.h @@ -26,10 +26,10 @@ #include "client.h" /** Check if a client is tiled */ -#define IS_TILED(client, screen, tags, ntags) (client && !client->isfloating && isvisible(client, tags, ntags) && client->screen == screen) +#define IS_TILED(client, screen, tags, ntags) (client && !client->isfloating && isvisible(client, screen, tags, ntags)) void compileregs(Rule *, int); /* initialize regexps of rules defined in config.h */ -Bool isvisible(Client *, Bool *, int); +Bool isvisible(Client *, int, Bool *, int); void applyrules(Client * c, awesome_config *); /* applies rules to c */ void uicb_tag(Display *, int, DC *, awesome_config *, const char *); /* tags sel with arg's index */ void uicb_togglefloating(Display *, int, DC *, awesome_config *, const char *); /* toggles sel between floating/tiled state */