change uicb_focus_history() to use focus_get_latest_client_for_tags() which now takes an index as arg
This commit is contained in:
parent
4e45103537
commit
48f92f60d1
30
focus.c
30
focus.c
|
@ -96,15 +96,22 @@ focus_delete_client(Client *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Client *
|
static Client *
|
||||||
focus_get_latest_client_for_tags(Tag **t)
|
focus_get_latest_client_for_tags(Tag **t, int nindex)
|
||||||
{
|
{
|
||||||
FocusList *fl;
|
FocusList *fl;
|
||||||
Tag **tags;
|
Tag **tags;
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
for(fl = globalconf.focus; fl; fl = fl->prev)
|
for(fl = globalconf.focus; fl; fl = fl->prev)
|
||||||
for(tags = t; *tags; tags++)
|
if(fl->client && !fl->client->skip)
|
||||||
if(is_client_tagged(fl->client, *t))
|
for(tags = t; *tags; tags++)
|
||||||
return fl->client;
|
if(is_client_tagged(fl->client, *t))
|
||||||
|
{
|
||||||
|
if(i == nindex)
|
||||||
|
return fl->client;
|
||||||
|
else
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -113,7 +120,7 @@ Client *
|
||||||
focus_get_current_client(int screen)
|
focus_get_current_client(int screen)
|
||||||
{
|
{
|
||||||
Tag **curtags = get_current_tags(screen);
|
Tag **curtags = get_current_tags(screen);
|
||||||
Client *sel = focus_get_latest_client_for_tags(curtags);
|
Client *sel = focus_get_latest_client_for_tags(curtags, 0);
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
|
|
||||||
return sel;
|
return sel;
|
||||||
|
@ -128,8 +135,8 @@ void
|
||||||
uicb_focus_history(int screen, char *arg)
|
uicb_focus_history(int screen, char *arg)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
FocusList *fl = globalconf.focus;
|
Tag **curtags;
|
||||||
Tag **curtags, **tag;
|
Client *c;
|
||||||
|
|
||||||
if(arg)
|
if(arg)
|
||||||
{
|
{
|
||||||
|
@ -138,13 +145,10 @@ uicb_focus_history(int screen, char *arg)
|
||||||
if(i < 0)
|
if(i < 0)
|
||||||
{
|
{
|
||||||
curtags = get_current_tags(screen);
|
curtags = get_current_tags(screen);
|
||||||
for(; fl && i < 0; fl = fl->prev)
|
c = focus_get_latest_client_for_tags(curtags, i);
|
||||||
for(tag = curtags; *tag; tag++)
|
|
||||||
if(is_client_tagged(fl->client, *tag))
|
|
||||||
i++;
|
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
if(fl)
|
if(c)
|
||||||
focus(fl->client, True, screen);
|
focus(c, True, screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue