diff options
author | OldMan <tele-post@mail.ru> | 2010-04-23 16:36:11 +0600 |
---|---|---|
committer | OldMan <tele-post@mail.ru> | 2010-04-23 16:36:11 +0600 |
commit | 6d1bd844f77382f7b16e439908b80e6aab46173f (patch) | |
tree | 40f2b3feb990faa48de6794f62060ceb43fe3aad | |
parent | 1d9bb77d83ea76669dbc9d565514b90dab365530 (diff) | |
download | wmfs-oldman.zip wmfs-oldman.tar.gz wmfs-oldman.tar.bz2 |
Tag: add uicb functions: tag_next_visible & tag_prev_visible.oldman
-rw-r--r-- | src/config.c | 2 | ||||
-rw-r--r-- | src/tag.c | 86 | ||||
-rw-r--r-- | src/wmfs.h | 2 | ||||
-rw-r--r-- | wmfsrc.in | 6 |
4 files changed, 96 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index beba467..660a123 100644 --- a/src/config.c +++ b/src/config.c @@ -51,6 +51,8 @@ func_name_list_t tmp_func_list[] = {"tag", uicb_tag }, {"tag_next", uicb_tag_next }, {"tag_prev", uicb_tag_prev }, + {"tag_next_visible", uicb_tag_next_visible }, + {"tag_prev_visible", uicb_tag_prev_visible }, {"tag_prev_sel", uicb_tag_prev_sel }, {"tag_transfert", uicb_tagtransfert }, {"tag_transfert_next", uicb_tagtransfert_next }, @@ -181,6 +181,92 @@ uicb_tag_prev(uicb_t cmd) return; } +/** Set the next visible tag + * \param cmd uicb_t type unused +*/ +void +uicb_tag_next_visible(uicb_t cmd) +{ + int i, tag; + Client *c; + Bool is_occupied[MAXTAG]; + + screen_get_sel(); + + if(!conf.tagautohide) + { + tag_set(seltag[selscreen] + 1); + return; + } + + for(i = 0; i < MAXTAG; i++) + is_occupied[i] = False; + + for(c = clients; c; c = c->next) + if(c->screen == selscreen) + is_occupied[c->tag] = True; + + for(tag = seltag[selscreen] + 1; tag < conf.ntag[selscreen] + 1; ++tag) + if(is_occupied[tag]) + { + tag_set(tag); + return; + } + + if(conf.tag_round) + for(tag = 0; tag < seltag[selscreen]; ++tag) + if(is_occupied[tag]) + { + tag_set(tag); + return; + } + + return; +} + +/** Set the prev visible tag + * \param cmd uicb_t type unused +*/ +void +uicb_tag_prev_visible(uicb_t cmd) +{ + int i, tag; + Client *c; + Bool is_occupied[MAXTAG]; + + screen_get_sel(); + + if(!conf.tagautohide) + { + tag_set(seltag[selscreen] - 1); + return; + } + + for(i = 0; i < MAXTAG; i++) + is_occupied[i] = False; + + for(c = clients; c; c = c->next) + if(c->screen == selscreen) + is_occupied[c->tag] = True; + + for(tag = seltag[selscreen] - 1; tag >= 0; --tag) + if(is_occupied[tag]) + { + tag_set(tag); + return; + } + + if(conf.tag_round) + for(tag = conf.ntag[selscreen]; tag > seltag[selscreen]; --tag) + if(is_occupied[tag]) + { + tag_set(tag); + return; + } + + return; +} + /** Transfert the selected client to * the wanted tag * \param cmd Wanted tag, uicb_t type @@ -297,6 +297,8 @@ void tag_transfert(Client *c, int tag); void uicb_tag(uicb_t); void uicb_tag_next(uicb_t); void uicb_tag_prev(uicb_t); +void uicb_tag_next_visible(uicb_t); +void uicb_tag_prev_visible(uicb_t); void uicb_tagtransfert(uicb_t); void uicb_tag_prev_sel(uicb_t); void uicb_tagtransfert_next(uicb_t); @@ -265,6 +265,12 @@ # Select the previous tag. [key] mod = {"Control"} key = "Left" func = "tag_prev" [/key] + # Select the next visible tag. + [key] mod = {"Control","Alt"} key = "Right" func = "tag_next_visible" [/key] + + # Select the previous visible tag. + [key] mod = {"Control","Alt"} key = "Left" func = "tag_prev_visible" [/key] + # Set the next layout. [key] mod = {"Alt"} key = "space" func = "layout_next" [/key] |