Avoid prev tag action at tag_screen for last tag
This commit is contained in:
parent
a6c235e062
commit
06cca7b413
10
src/tag.c
10
src/tag.c
@ -35,6 +35,8 @@ tag_new(struct screen *s, char *name)
|
|||||||
else
|
else
|
||||||
t->name = xstrdup(name);
|
t->name = xstrdup(name);
|
||||||
|
|
||||||
|
printf("->t->name <%s>\n", t->name);
|
||||||
|
|
||||||
SLIST_INIT(&t->clients);
|
SLIST_INIT(&t->clients);
|
||||||
TAILQ_INIT(&t->sets);
|
TAILQ_INIT(&t->sets);
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ tag_new(struct screen *s, char *name)
|
|||||||
void
|
void
|
||||||
tag_screen(struct screen *s, struct tag *t)
|
tag_screen(struct screen *s, struct tag *t)
|
||||||
{
|
{
|
||||||
if(t == s->seltag)
|
if(t == s->seltag && TAILQ_NEXT(t, next))
|
||||||
t = t->prev;
|
t = t->prev;
|
||||||
|
|
||||||
if(!t)
|
if(!t)
|
||||||
@ -256,11 +258,7 @@ uicb_tag_del(Uicb cmd)
|
|||||||
if(SLIST_EMPTY(&t->clients)
|
if(SLIST_EMPTY(&t->clients)
|
||||||
&& TAILQ_NEXT(TAILQ_FIRST(&W->screen->tags), next))
|
&& TAILQ_NEXT(TAILQ_FIRST(&W->screen->tags), next))
|
||||||
{
|
{
|
||||||
struct tag *n = (TAILQ_NEXT(t, next)
|
tag_screen(W->screen, TAILQ_NEXT(t, next));
|
||||||
? TAILQ_NEXT(t, next)
|
|
||||||
: TAILQ_FIRST(&W->screen->tags));
|
|
||||||
|
|
||||||
tag_screen(W->screen, n);
|
|
||||||
tag_remove(t);
|
tag_remove(t);
|
||||||
|
|
||||||
W->screen->flags |= SCREEN_TAG_UPDATE;
|
W->screen->flags |= SCREEN_TAG_UPDATE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user