switch to get_current_tags() in layout.c

This commit is contained in:
Julien Danjou 2007-12-27 12:56:04 +01:00
parent 238eb7f346
commit 652fdc6cce
1 changed files with 15 additions and 7 deletions

View File

@ -71,7 +71,7 @@ void
arrange(int screen) arrange(int screen)
{ {
Client *c; Client *c;
Tag *curtag = get_current_tag(screen); Tag **curtags = get_current_tags(screen);
for(c = globalconf.clients; c; c = c->next) for(c = globalconf.clients; c; c = c->next)
{ {
@ -82,9 +82,10 @@ arrange(int screen)
client_ban(c); client_ban(c);
} }
curtag->layout->arrange(screen); curtags[0]->layout->arrange(screen);
focus(focus_get_latest_client_for_tag(screen, curtag), focus(focus_get_latest_client_for_tag(screen, curtags[0]),
True, screen); True, screen);
p_delete(&curtags);
restack(screen); restack(screen);
} }
@ -176,18 +177,22 @@ restack(int screen)
Client *c, *sel = globalconf.focus->client; Client *c, *sel = globalconf.focus->client;
XEvent ev; XEvent ev;
XWindowChanges wc; XWindowChanges wc;
Tag **curtags;
statusbar_draw(screen); statusbar_draw(screen);
if(!sel) if(!sel)
return; return;
if(globalconf.screens[screen].allow_lower_floats) if(globalconf.screens[screen].allow_lower_floats)
XRaiseWindow(globalconf.display, sel->win); XRaiseWindow(globalconf.display, sel->win);
else else
{ {
curtags = get_current_tags(screen);
if(sel->isfloating || if(sel->isfloating ||
get_current_layout(screen)->arrange == layout_floating) curtags[0]->layout->arrange == layout_floating)
XRaiseWindow(sel->display, sel->win); XRaiseWindow(sel->display, sel->win);
if(!(get_current_layout(screen)->arrange == layout_floating)) if(!(curtags[0]->layout->arrange == layout_floating))
{ {
wc.stack_mode = Below; wc.stack_mode = Below;
wc.sibling = globalconf.screens[screen].statusbar->window; wc.sibling = globalconf.screens[screen].statusbar->window;
@ -204,6 +209,7 @@ restack(int screen)
wc.sibling = c->win; wc.sibling = c->win;
} }
} }
p_delete(&curtags);
} }
if(globalconf.screens[screen].focus_move_pointer) if(globalconf.screens[screen].focus_move_pointer)
XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, sel->w / 2, sel->h / 2); XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, sel->w / 2, sel->h / 2);
@ -243,12 +249,14 @@ void
uicb_tag_setlayout(int screen, char *arg) uicb_tag_setlayout(int screen, char *arg)
{ {
Layout *l = globalconf.screens[screen].layouts; Layout *l = globalconf.screens[screen].layouts;
Tag *tag; Tag *tag, **curtags;
int i; int i;
if(arg) if(arg)
{ {
for(i = 0; l && l != get_current_layout(screen); i++, l = l->next); curtags = get_current_tags(screen);
for(i = 0; l && l != curtags[0]->layout; i++, l = l->next);
p_delete(&curtags);
if(!l) if(!l)
i = 0; i = 0;
for(i = compute_new_value_from_arg(arg, (double) i), for(i = compute_new_value_from_arg(arg, (double) i),