From c58a75539b49223174c45ef56ce132d0043c9683 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 6 Apr 2009 03:04:37 +0200 Subject: [PATCH] Client: Fix arrangement bug: add screen argument to ishide(). --- src/client.c | 18 +++++++++--------- src/layout.c | 10 +++++----- src/mouse.c | 2 +- src/wmfs.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/client.c b/src/client.c index adb6c10..c70682a 100644 --- a/src/client.c +++ b/src/client.c @@ -92,16 +92,16 @@ uicb_client_prev(uicb_t cmd) { Client *c = NULL, *d; - if(!sel || ishide(sel)) + if(!sel || ishide(sel, selscreen)) return; for(d = clients; d != sel; d = d->next) - if(!ishide(d)) + if(!ishide(d, selscreen)) c = d; if(!c) for(; d; d = d->next) - if(!ishide(d)) + if(!ishide(d, selscreen)) c = d; if(c) { @@ -120,12 +120,12 @@ uicb_client_next(uicb_t cmd) { Client *c = NULL; - if(!sel || ishide(sel)) + if(!sel || ishide(sel, selscreen)) return; - for(c = sel->next; c && ishide(c); c = c->next); + for(c = sel->next; c && ishide(c, selscreen); c = c->next); if(!c) - for(c = clients; c && ishide(c); c = c->next); + for(c = clients; c && ishide(c, selscreen); c = c->next); if(c) { client_focus(c); @@ -304,12 +304,12 @@ client_hide(Client *c) * \return True if the client is hide; False if not */ Bool -ishide(Client *c) +ishide(Client *c, int screen) { screen_get_sel(); - if(c->tag && c->tag == seltag[selscreen] - && c->screen == selscreen) + if(c->tag == seltag[screen] + && c->screen == screen) return False; return True; } diff --git a/src/layout.c b/src/layout.c index 6c77164..ce81e06 100644 --- a/src/layout.c +++ b/src/layout.c @@ -42,7 +42,7 @@ arrange(int screen) for(c = clients; c; c = c->next) if(c->screen == screen) { - if(!ishide(c)) + if(!ishide(c, screen)) client_unhide(c); else client_hide(c); @@ -62,7 +62,7 @@ freelayout(int screen) Client *c; for(c = clients; c; c = c->next) - if(!ishide(c) && c->screen == screen_get_sel()) + if(!ishide(c, selscreen) && c->screen == screen_get_sel()) { client_moveresize(c, c->ogeo, True); c->tile = c->lmax = False; @@ -160,7 +160,7 @@ tiled_client(int screen, Client *c) || c->free || c->screen != screen || c->state_fullscreen - || ishide(c)); c = c->next); + || ishide(c, screen)); c = c->next); return c; } @@ -231,7 +231,7 @@ grid(int screen) ? rows - 1 : rows; - for(i = 0, c =tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) + for(i = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++i) { /* Set client property */ c->max = c->lmax = False; @@ -688,7 +688,7 @@ uicb_togglefree(uicb_t cmd) void uicb_togglemax(uicb_t cmd) { - if(!sel || ishide(sel) || sel->hint || sel->state_fullscreen) + if(!sel || ishide(sel, selscreen) || sel->hint || sel->state_fullscreen) return; if(!sel->max) diff --git a/src/mouse.c b/src/mouse.c index 5848a2f..c79848f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -86,7 +86,7 @@ mouse_move(Client *c) if(infobar[selscreen].tags[i]->win == sw) { c->screen = selscreen; - tag_transfert(c, i); + c->tag = i; arrange(selscreen); if(c->screen != oscreen) arrange(oscreen); diff --git a/src/wmfs.h b/src/wmfs.h index ce26a96..9baaea4 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -139,7 +139,7 @@ Client* client_gb_button(Window w, int *n); void client_get_name(Client *c); void client_hide(Client *c); void client_kill(Client *c); -Bool ishide(Client *c); +Bool ishide(Client *c, int screen); void client_map(Client *c); void client_manage(Window w, XWindowAttributes *wa); void client_moveresize(Client *c, XRectangle geo, Bool r);