Skip to content

Commit

Permalink
Merge pull request #46 from linkdd/master
Browse files Browse the repository at this point in the history
Add circular option
  • Loading branch information
xorg62 committed May 1, 2012
2 parents da97ee7 + eecde87 commit 6e171ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ config_tag(void)
ks = fetch_section(sec, "tag");
n = fetch_section_count(ks);

W->tag_circular = fetch_opt_first(sec, "1", "circular").boolean;

/* [mouse] */
if((mb = fetch_section(sec, "mouse")))
{
Expand Down
2 changes: 1 addition & 1 deletion src/parse_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ string_to_opt(char *s)
ret.fnum = strtod(s, NULL);

ret.boolean = (!strcmp(s, "true")
|| !strcmp(s, "true")
|| !strcmp(s, "True")
|| !strcmp(s, "TRUE")
|| !strcmp(s, "1"));

Expand Down
10 changes: 5 additions & 5 deletions src/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ uicb_tag_next(Uicb cmd)
struct tag *t;

if((t = TAILQ_NEXT(W->screen->seltag, next)))
tag_screen(W->screen, t);
else if( /* CIRCULAR OPTION */ 1)
tag_screen(W->screen, t);
else if(W->tag_circular)
tag_screen(W->screen, TAILQ_FIRST(&W->screen->tags));
}

Expand All @@ -182,7 +182,7 @@ uicb_tag_prev(Uicb cmd)

if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
tag_screen(W->screen, t);
else if( /* CIRCULAR OPTION */ 1)
else if(W->tag_circular)
tag_screen(W->screen, TAILQ_LAST(&W->screen->tags, tsub));
}

Expand Down Expand Up @@ -214,7 +214,7 @@ uicb_tag_move_client_next(Uicb cmd)

if((t = TAILQ_NEXT(W->screen->seltag, next)))
tag_client(t, W->client);
else if( /* CIRCULAR OPTION */ 1)
else if(W->tag_circular)
tag_client(TAILQ_FIRST(&W->screen->tags), W->client);
}

Expand All @@ -229,7 +229,7 @@ uicb_tag_move_client_prev(Uicb cmd)

if((t = TAILQ_PREV(W->screen->seltag, tsub, next)))
tag_client(t, W->client);
else if( /* CIRCULAR OPTION */ 1)
else if(W->tag_circular)
tag_client(TAILQ_LAST(&W->screen->tags, tsub), W->client);
}

Expand Down
2 changes: 2 additions & 0 deletions src/wmfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ struct wmfs
#define CFOCUS_CLICK 0x02
Flags cfocus; /* Focus configuration, can be set to 0, CFOCUS_ENTER or CFOCUS_CLICK*/

bool tag_circular;

/* Log file */
FILE *log;

Expand Down
2 changes: 2 additions & 0 deletions wmfsrc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@

[tags]

circular = false

# Use no screen option or screen = -1 to set tag on each screen
[tag]
screen = -1
Expand Down

0 comments on commit 6e171ff

Please sign in to comment.