use get_curent_tags() in tile.c
This commit is contained in:
parent
88b3f28f49
commit
c919fce900
|
@ -33,14 +33,16 @@ extern AwesomeConf globalconf;
|
||||||
void
|
void
|
||||||
uicb_tag_setnmaster(int screen, char * arg)
|
uicb_tag_setnmaster(int screen, char * arg)
|
||||||
{
|
{
|
||||||
Tag *curtag = get_current_tag(screen);
|
Tag **curtags = get_current_tags(screen);
|
||||||
Layout *curlay = curtag->layout;
|
Layout *curlay = curtags[0]->layout;
|
||||||
|
|
||||||
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((curtag->nmaster = (int) compute_new_value_from_arg(arg, (double) curtag->nmaster)) < 0)
|
if((curtags[0]->nmaster = (int) compute_new_value_from_arg(arg, (double) curtags[0]->nmaster)) < 0)
|
||||||
curtag->nmaster = 0;
|
curtags[0]->nmaster = 0;
|
||||||
|
|
||||||
|
p_delete(&curtags);
|
||||||
|
|
||||||
arrange(screen);
|
arrange(screen);
|
||||||
}
|
}
|
||||||
|
@ -48,14 +50,16 @@ uicb_tag_setnmaster(int screen, char * arg)
|
||||||
void
|
void
|
||||||
uicb_tag_setncol(int screen, char * arg)
|
uicb_tag_setncol(int screen, char * arg)
|
||||||
{
|
{
|
||||||
Tag *curtag = get_current_tag(screen);
|
Tag **curtags = get_current_tags(screen);
|
||||||
Layout *curlay = curtag->layout;
|
Layout *curlay = curtags[0]->layout;
|
||||||
|
|
||||||
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((curtag->ncol = (int) compute_new_value_from_arg(arg, (double) curtag->ncol)) < 1)
|
if((curtags[0]->ncol = (int) compute_new_value_from_arg(arg, (double) curtags[0]->ncol)) < 1)
|
||||||
curtag->ncol = 1;
|
curtags[0]->ncol = 1;
|
||||||
|
|
||||||
|
p_delete(&curtags);
|
||||||
|
|
||||||
arrange(screen);
|
arrange(screen);
|
||||||
}
|
}
|
||||||
|
@ -64,8 +68,8 @@ void
|
||||||
uicb_tag_setmwfact(int screen, char *arg)
|
uicb_tag_setmwfact(int screen, char *arg)
|
||||||
{
|
{
|
||||||
char *newarg;
|
char *newarg;
|
||||||
Tag *curtag = get_current_tag(screen);
|
Tag **curtags = get_current_tags(screen);
|
||||||
Layout *curlay = curtag->layout;
|
Layout *curlay = curtags[0]->layout;
|
||||||
|
|
||||||
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
if(!arg || (curlay->arrange != layout_tile && curlay->arrange != layout_tileleft))
|
||||||
return;
|
return;
|
||||||
|
@ -79,13 +83,14 @@ uicb_tag_setmwfact(int screen, char *arg)
|
||||||
newarg[0] = '+';
|
newarg[0] = '+';
|
||||||
}
|
}
|
||||||
|
|
||||||
if((curtag->mwfact = compute_new_value_from_arg(newarg, curtag->mwfact)) < 0.1)
|
if((curtags[0]->mwfact = compute_new_value_from_arg(newarg, curtags[0]->mwfact)) < 0.1)
|
||||||
curtag->mwfact = 0.1;
|
curtags[0]->mwfact = 0.1;
|
||||||
else if(curtag->mwfact > 0.9)
|
else if(curtags[0]->mwfact > 0.9)
|
||||||
curtag->mwfact = 0.9;
|
curtags[0]->mwfact = 0.9;
|
||||||
|
|
||||||
arrange(screen);
|
|
||||||
p_delete(&newarg);
|
p_delete(&newarg);
|
||||||
|
p_delete(&curtags);
|
||||||
|
arrange(screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -101,7 +106,7 @@ _tile(int screen, const Bool right)
|
||||||
int real_ncol = 1, win_by_col = 1, current_col = 0;
|
int real_ncol = 1, win_by_col = 1, current_col = 0;
|
||||||
Area area;
|
Area area;
|
||||||
Client *c;
|
Client *c;
|
||||||
Tag *curtag = get_current_tag(screen);
|
Tag **curtags = get_current_tags(screen);
|
||||||
|
|
||||||
area = get_screen_area(screen,
|
area = get_screen_area(screen,
|
||||||
globalconf.screens[screen].statusbar,
|
globalconf.screens[screen].statusbar,
|
||||||
|
@ -116,22 +121,22 @@ _tile(int screen, const Bool right)
|
||||||
wax = area.x;
|
wax = area.x;
|
||||||
way = area.y;
|
way = area.y;
|
||||||
|
|
||||||
masterwin = MIN(n, curtag->nmaster);
|
masterwin = MIN(n, curtags[0]->nmaster);
|
||||||
|
|
||||||
otherwin = n - masterwin;
|
otherwin = n - masterwin;
|
||||||
|
|
||||||
if(otherwin < 0)
|
if(otherwin < 0)
|
||||||
otherwin = 0;
|
otherwin = 0;
|
||||||
|
|
||||||
if(curtag->nmaster)
|
if(curtags[0]->nmaster)
|
||||||
{
|
{
|
||||||
mh = masterwin ? wah / masterwin : waw;
|
mh = masterwin ? wah / masterwin : waw;
|
||||||
mw = otherwin ? waw * curtag->mwfact : waw;
|
mw = otherwin ? waw * curtags[0]->mwfact : waw;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mh = mw = 0;
|
mh = mw = 0;
|
||||||
|
|
||||||
real_ncol = curtag->ncol > 0 ? MIN(otherwin, curtag->ncol) : MIN(otherwin, 1);
|
real_ncol = curtags[0]->ncol > 0 ? MIN(otherwin, curtags[0]->ncol) : MIN(otherwin, 1);
|
||||||
|
|
||||||
for(i = 0, c = globalconf.clients; c; c = c->next)
|
for(i = 0, c = globalconf.clients; c; c = c->next)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +144,7 @@ _tile(int screen, const Bool right)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
if(i < curtag->nmaster)
|
if(i < curtags[0]->nmaster)
|
||||||
{ /* master */
|
{ /* master */
|
||||||
ny = way + i * mh;
|
ny = way + i * mh;
|
||||||
nx = wax + (right ? 0 : waw - mw);
|
nx = wax + (right ? 0 : waw - mw);
|
||||||
|
@ -150,7 +155,7 @@ _tile(int screen, const Bool right)
|
||||||
if(real_ncol)
|
if(real_ncol)
|
||||||
win_by_col = otherwin / real_ncol;
|
win_by_col = otherwin / real_ncol;
|
||||||
|
|
||||||
if((i - curtag->nmaster) && (i - curtag->nmaster) % win_by_col == 0 && current_col < real_ncol - 1)
|
if((i - curtags[0]->nmaster) && (i - curtags[0]->nmaster) % win_by_col == 0 && current_col < real_ncol - 1)
|
||||||
current_col++;
|
current_col++;
|
||||||
|
|
||||||
if(current_col == real_ncol - 1)
|
if(current_col == real_ncol - 1)
|
||||||
|
@ -163,16 +168,18 @@ _tile(int screen, const Bool right)
|
||||||
|
|
||||||
nw = (waw - mw) / real_ncol - 2 * c->border;
|
nw = (waw - mw) / real_ncol - 2 * c->border;
|
||||||
|
|
||||||
if(i == curtag->nmaster || otherwin <= real_ncol || (i - curtag->nmaster) % win_by_col == 0)
|
if(i == curtags[0]->nmaster || otherwin <= real_ncol || (i - curtags[0]->nmaster) % win_by_col == 0)
|
||||||
ny = way;
|
ny = way;
|
||||||
else
|
else
|
||||||
ny = way + ((i - curtag->nmaster) % win_by_col) * (nh + 2 * c->border);
|
ny = way + ((i - curtags[0]->nmaster) % win_by_col) * (nh + 2 * c->border);
|
||||||
|
|
||||||
nx = wax + current_col * (nw + 2 * c->border) + (right ? mw : 0);
|
nx = wax + current_col * (nw + 2 * c->border) + (right ? mw : 0);
|
||||||
client_resize(c, nx, ny, nw, nh, globalconf.screens[screen].resize_hints, False);
|
client_resize(c, nx, ny, nw, nh, globalconf.screens[screen].resize_hints, False);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_delete(&curtags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue