focus_get_latest_client_for_tags() now supports Tag **, use it for widgets
This commit is contained in:
parent
a1f5e2ee22
commit
8f9be2289a
7
focus.c
7
focus.c
|
@ -95,13 +95,14 @@ focus_delete_client(Client *c)
|
|||
}
|
||||
|
||||
Client *
|
||||
focus_get_latest_client_for_tag(int screen, Tag *t)
|
||||
focus_get_latest_client_for_tags(int screen, Tag **t)
|
||||
{
|
||||
FocusList *fl;
|
||||
|
||||
for(fl = globalconf.focus; fl; fl = fl->prev)
|
||||
if(is_client_tagged(fl->client, t, screen))
|
||||
return fl->client;
|
||||
for(; *t; t++)
|
||||
if(is_client_tagged(fl->client, *t, screen))
|
||||
return fl->client;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
2
focus.h
2
focus.h
|
@ -26,7 +26,7 @@
|
|||
|
||||
void focus_add_client(Client *);
|
||||
void focus_delete_client(Client *);
|
||||
Client * focus_get_latest_client_for_tag(int, Tag *);
|
||||
Client * focus_get_latest_client_for_tags(int, Tag **);
|
||||
|
||||
UICB_PROTO(uicb_focus_history);
|
||||
UICB_PROTO(uicb_focus_client_byname);
|
||||
|
|
2
layout.c
2
layout.c
|
@ -67,7 +67,7 @@ arrange(int screen)
|
|||
}
|
||||
|
||||
curtags[0]->layout->arrange(screen);
|
||||
focus(focus_get_latest_client_for_tag(screen, curtags[0]),
|
||||
focus(focus_get_latest_client_for_tags(screen, curtags),
|
||||
True, screen);
|
||||
p_delete(&curtags);
|
||||
restack(screen);
|
||||
|
|
2
screen.c
2
screen.c
|
@ -264,7 +264,7 @@ uicb_screen_focus(int screen, char *arg)
|
|||
if (new_screen > (numscreens - 1))
|
||||
new_screen = 0;
|
||||
|
||||
focus(focus_get_latest_client_for_tag(new_screen, curtags[0]),
|
||||
focus(focus_get_latest_client_for_tags(new_screen, curtags),
|
||||
True, new_screen);
|
||||
|
||||
p_delete(&curtags);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "util.h"
|
||||
#include "widget.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
#include "focus.h"
|
||||
|
||||
extern AwesomeConf globalconf;
|
||||
|
@ -33,7 +34,10 @@ static int
|
|||
focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
||||
{
|
||||
VirtScreen vscreen = globalconf.screens[widget->statusbar->screen];
|
||||
Client *sel = globalconf.focus->client;
|
||||
Tag **curtags = get_current_tags(widget->statusbar->screen);
|
||||
Client *sel = focus_get_latest_client_for_tags(widget->statusbar->screen, curtags);
|
||||
|
||||
p_delete(&curtags);
|
||||
|
||||
widget->location = widget_calculate_offset(vscreen.statusbar->width,
|
||||
0,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <confuse.h>
|
||||
#include "util.h"
|
||||
#include "focus.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
#include "widget.h"
|
||||
|
||||
extern AwesomeConf globalconf;
|
||||
|
@ -38,7 +38,10 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
int format, width, height, size, i;
|
||||
unsigned long items, rest;
|
||||
unsigned char *image, *imgdata;
|
||||
Client *sel = globalconf.focus->client;
|
||||
Tag **curtags = get_current_tags(widget->statusbar->screen);
|
||||
Client *sel = focus_get_latest_client_for_tags(widget->statusbar->screen, curtags);
|
||||
|
||||
p_delete(&curtags);
|
||||
|
||||
if(!sel)
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue