Add "stay_last_tag" fonction/keybind
This commit is contained in:
parent
546366b282
commit
f928497e70
@ -70,6 +70,7 @@ const func_name_list_t func_list[] =
|
|||||||
{"tag_del", uicb_tag_del },
|
{"tag_del", uicb_tag_del },
|
||||||
{"tag_rename", uicb_tag_rename },
|
{"tag_rename", uicb_tag_rename },
|
||||||
{"tag_last", uicb_tag_last },
|
{"tag_last", uicb_tag_last },
|
||||||
|
{"tag_stay_last", uicb_tag_stay_last },
|
||||||
{"set_mwfact", uicb_set_mwfact },
|
{"set_mwfact", uicb_set_mwfact },
|
||||||
{"set_nmaster", uicb_set_nmaster },
|
{"set_nmaster", uicb_set_nmaster },
|
||||||
{"quit", uicb_quit },
|
{"quit", uicb_quit },
|
||||||
@ -500,7 +501,7 @@ conf_tag_section(void)
|
|||||||
False, fetch_opt_first(def_tag, "false", "resizehint").bool,
|
False, fetch_opt_first(def_tag, "false", "resizehint").bool,
|
||||||
False, False, bar_pos,
|
False, False, bar_pos,
|
||||||
layout_name_to_struct(conf.layout, fetch_opt_first(def_tag, "title_right", "layout").str, conf.nlayout, layout_list),
|
layout_name_to_struct(conf.layout, fetch_opt_first(def_tag, "title_right", "layout").str, conf.nlayout, layout_list),
|
||||||
0, NULL, 0 };
|
0, NULL, 0, False };
|
||||||
|
|
||||||
conf.default_tag = default_tag;
|
conf.default_tag = default_tag;
|
||||||
|
|
||||||
|
|||||||
@ -288,6 +288,7 @@ typedef struct
|
|||||||
uint tagad;
|
uint tagad;
|
||||||
MouseBinding *mouse;
|
MouseBinding *mouse;
|
||||||
int nmouse;
|
int nmouse;
|
||||||
|
Bool stay_last;
|
||||||
} Tag;
|
} Tag;
|
||||||
|
|
||||||
/* Menu Item Struct */
|
/* Menu Item Struct */
|
||||||
|
|||||||
42
src/tag.c
42
src/tag.c
@ -291,6 +291,7 @@ uicb_tag_prev_visible(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_last(uicb_t cmd)
|
uicb_tag_last(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
(void)cmd;
|
||||||
screen_get_sel();
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(conf.ntag[selscreen]);
|
tag_set(conf.ntag[selscreen]);
|
||||||
@ -298,6 +299,23 @@ uicb_tag_last(uicb_t cmd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Keep that tag the last one
|
||||||
|
*\param cmd uicb_t type unused
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
uicb_tag_stay_last(uicb_t cmd)
|
||||||
|
{
|
||||||
|
/*warnx("in uicb_tag_stay_last\n");*/
|
||||||
|
(void)cmd;
|
||||||
|
screen_get_sel();
|
||||||
|
|
||||||
|
remove_old_last_tag(selscreen);
|
||||||
|
|
||||||
|
tag_set(conf.ntag[selscreen]);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/** Transfert the selected client to
|
/** Transfert the selected client to
|
||||||
* the wanted tag
|
* the wanted tag
|
||||||
* \param cmd Wanted tag, uicb_t type
|
* \param cmd Wanted tag, uicb_t type
|
||||||
@ -538,7 +556,7 @@ tag_new(int s, char *name)
|
|||||||
conf.default_tag.mwfact, conf.default_tag.nmaster,
|
conf.default_tag.mwfact, conf.default_tag.nmaster,
|
||||||
False, conf.default_tag.resizehint, False, False,
|
False, conf.default_tag.resizehint, False, False,
|
||||||
conf.default_tag.barpos, conf.default_tag.layout,
|
conf.default_tag.barpos, conf.default_tag.layout,
|
||||||
0, NULL, 0 };
|
0, NULL, 0, False };
|
||||||
|
|
||||||
|
|
||||||
tags[s][conf.ntag[s]] = t;
|
tags[s][conf.ntag[s]] = t;
|
||||||
@ -648,3 +666,25 @@ uicb_tag_rename(uicb_t cmd)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*\param selscreen int
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
remove_old_last_tag(int selscreen)
|
||||||
|
{
|
||||||
|
/*warnx("in remove_old_last_tag\n");*/
|
||||||
|
/*warnx("il y a %d tag sur l ecran %d\n", conf.ntag[selscreen], selscreen);*/
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < conf.ntag[selscreen]; i++)
|
||||||
|
{
|
||||||
|
/*warnx("i = %d", i);*/
|
||||||
|
if(tags[selscreen][i].stay_last)
|
||||||
|
{
|
||||||
|
tags[selscreen][i].stay_last = False;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|||||||
@ -331,6 +331,8 @@ void tag_delete(int s, int tag);
|
|||||||
void uicb_tag_del(uicb_t);
|
void uicb_tag_del(uicb_t);
|
||||||
void uicb_tag_rename(uicb_t cmd);
|
void uicb_tag_rename(uicb_t cmd);
|
||||||
void uicb_tag_last(uicb_t cmd);
|
void uicb_tag_last(uicb_t cmd);
|
||||||
|
void uicb_tag_stay_last(uicb_t cmd);
|
||||||
|
void remove_old_last_tag(int selscreen);
|
||||||
|
|
||||||
/* screen.c */
|
/* screen.c */
|
||||||
int screen_count(void);
|
int screen_count(void);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user