From 03c41f9b3b1560824bedd27af1f966c9661fdd08 Mon Sep 17 00:00:00 2001 From: "bacardi55@gmail.com" Date: Wed, 5 Jan 2011 19:51:48 +0100 Subject: [PATCH] Add option (tag_auto_prev) in wmfsrc to disable the auto tag prev when going twice on the same tag. --- src/config.c | 1 + src/structs.h | 1 + src/tag.c | 2 +- wmfsrc | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 6afa98c..9a61991 100644 --- a/src/config.c +++ b/src/config.c @@ -470,6 +470,7 @@ conf_tag_section(void) sec = fetch_section_first(NULL, "tags"); conf.tag_round = fetch_opt_first(sec, "false", "tag_round").bool; + conf.tag_auto_prev = fetch_opt_first(sec, "true", "tag_auto_prev").bool; conf.colors.tagselfg = fetch_opt_first(sec, "#ffffff", "sel_fg").str; conf.colors.tagselbg = getcolor(fetch_opt_first(sec, "#000000", "sel_bg").str); conf.colors.tagurfg = fetch_opt_first(sec, "#000000", "urgent_fg").str; diff --git a/src/structs.h b/src/structs.h index 3ed0243..34587b6 100644 --- a/src/structs.h +++ b/src/structs.h @@ -480,6 +480,7 @@ typedef struct Rule *rule; int *ntag; Bool tag_round; + Bool tag_auto_prev; Bool client_round; Bool layout_system; /* Switch: False, Menu: True. */ Bool layout_placement; /* Right (normal): False, Left: True. */ diff --git a/src/tag.c b/src/tag.c index ec28089..63a409d 100644 --- a/src/tag.c +++ b/src/tag.c @@ -49,7 +49,7 @@ tag_set(int tag) if(seltag[selscreen] != tag) prevseltag[selscreen] = seltag[selscreen]; - else if(tag == seltag[selscreen] && tag != prevseltag[selscreen]) + else if(tag == seltag[selscreen] && tag != prevseltag[selscreen] && conf.tag_auto_prev) tag = seltag[selscreen] = prevseltag[selscreen]; else seltag[selscreen] = tag; diff --git a/wmfsrc b/wmfsrc index 2955efc..75e64cb 100644 --- a/wmfsrc +++ b/wmfsrc @@ -98,6 +98,7 @@ [/default_tag] tag_round = false + tag_auto_prev = true occupied_bg = "#003366" occupied_fg = "#D4D4D4" sel_fg = "#191919"