Conf: Add "split" bool option in [tag] section

This commit is contained in:
Martin Duquesnoy 2011-06-03 17:47:41 +02:00
parent 7b47fd041a
commit 0445bb05da
6 changed files with 24 additions and 4 deletions

View File

@ -742,6 +742,9 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
c->free_geo = c->pgeo = c->wrgeo = c->split_geo = c->geo;
c->tag = seltag[c->screen];
c->focusontag = -1;
/* Set tilefact to 0 */
tags[c->screen][c->tag].flags |= CleanFactFlag;
cfactor_clean(c);
at.event_mask = PropertyChangeMask;
@ -771,7 +774,6 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
client_attach(c);
client_set_rules(c);
client_get_name(c);
tags[c->screen][c->tag].flags |= CleanFactFlag;
if(c->tag == (uint)seltag[selscreen])
{

View File

@ -549,9 +549,13 @@ conf_tag_section(void)
};
FLAGAPPLY(default_tag.flags,
fetch_opt_first(def_tag, "False", "resizehint").bool,
fetch_opt_first(def_tag, "false", "resizehint").bool,
ResizeHintFlag);
FLAGAPPLY(default_tag.flags,
fetch_opt_first(def_tag, "false", "split").bool,
(SplitFlag | FirstArrangeFlag));
conf.default_tag = default_tag;
/* Mouse button action on tag */
@ -607,6 +611,10 @@ conf_tag_section(void)
fetch_opt_first(tag[i], "false", "abovefc").bool,
AboveFCFlag);
FLAGAPPLY(tags[k][conf.ntag[k]].flags,
fetch_opt_first(tag[i], "false", "split").bool,
(SplitFlag | FirstArrangeFlag));
tmp = fetch_opt_first(tag[i], fetch_opt_first(def_tag, "top", "infobar_position").str, "infobar_position").str;
if(!strcmp(tmp ,"none") || !strcmp(tmp, "hide") || !strcmp(tmp, "hidden"))

View File

@ -67,10 +67,14 @@ arrange(int screen, Bool update_layout)
void
layout_func(int screen, int tag)
{
if(tags[screen][tag].flags & SplitFlag)
if((tags[screen][tag].flags & SplitFlag)
&& !(tags[screen][tag].flags & FirstArrangeFlag))
split_apply_current(screen, tag);
else
{
tags[screen][tag].layout.func(screen);
tags[screen][tag].flags &= ~FirstArrangeFlag;
}
return;
}
@ -130,6 +134,7 @@ layoutswitch(Bool b)
ewmh_update_current_tag_prop();
tags[selscreen][seltag[selscreen]].flags |= CleanFactFlag;
tags[selscreen][seltag[selscreen]].flags &= ~SplitFlag;
layout_func(selscreen, seltag[selscreen]);
infobar_draw(selscreen);
@ -864,6 +869,7 @@ uicb_set_layout(uicb_t cmd)
tags[selscreen][seltag[selscreen]].layout = conf.layout[j];
tags[selscreen][seltag[selscreen]].flags |= CleanFactFlag;
tags[selscreen][seltag[selscreen]].flags &= ~SplitFlag;
arrange(selscreen, True);
return;

View File

@ -92,7 +92,7 @@ split_apply_current(int screen, int tag)
/* Integrate in split mode */
if(tags[screen][tag].layout.flags & IntegrationFlag)
{
if(tags[screen][tag].layout.nc == (c = sel)
if(!(c = sel) || tags[screen][tag].layout.nc == c
|| c->screen != screen || c->tag != tag)
c = client_get_next();
@ -312,6 +312,7 @@ split_client_integrate(Client *c, Client *sc, int screen, int tag)
c->geo.y = sgeo[screen].y;
client_maximize(c);
c->flags |= TileFlag;
return;
}

View File

@ -66,6 +66,7 @@
#define CleanFactFlag (1 << 5)
#define StayLastFlag (1 << 6)
#define SplitFlag (1 << 7)
#define FirstArrangeFlag (1 << 8)
#define TagFlag(t) (1 << (t))

2
wmfsrc
View File

@ -103,6 +103,7 @@
layout = "tile"
resizehint = false
infobar_position = "top"
split = false
[/default_tag]
# whether client_next on the last tag will send you on the first
@ -149,6 +150,7 @@
resizehint = false
infobar_position = "top"
above_fc = false
split = false
#[mouse] [/mouse] Possible multi mouse section
[/tag]