commit 9ade67af99ec87ccd01684665317b8af4b13cc93
parent abf4198f682784af6545028d29c0e3cc7048628d
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Tue, 4 Apr 2006 12:25:36 +0200
removed view <tags>, instead view <tag>, removed ~ labelling of tag labels in the bar
Diffstat:
6 files changed, 14 insertions(+), 61 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -115,11 +115,6 @@ select_area(Area *a, char *arg)
v->sel = i;
for(i = 0; i < a->frame.size; i++)
draw_client(a->frame.data[i]->client);
-
- if(!new->frame.size) {
- update_view_label(v);
- draw_bar();
- }
}
void
diff --git a/cmd/wm/bar.c b/cmd/wm/bar.c
@@ -8,20 +8,6 @@
#include "wm.h"
-void
-update_view_label(View *v)
-{
- static char vname[256];
- Label *l;
- tags2str(vname, sizeof(vname), v->tag, v->ntag);
- if((l = name2label(vname))) {
- if(!v->sel)
- snprintf(l->data, sizeof(l->data), "~%s", vname);
- else
- cext_strlcpy(l->data, vname, sizeof(l->data));
- }
-}
-
static int
comp_label_intern(const void *l1, const void *l2)
{
@@ -230,8 +216,6 @@ update_bar_tags()
l = get_label(tag.data[i], True);
cext_strlcpy(l->data, tag.data[i], sizeof(l->data));
}
- for(i = 0; i < view.size; i++)
- update_view_label(view.data[i]);
draw_bar();
}
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -99,8 +99,6 @@ focus_client(Client *c)
grab_mouse(c->framewin, Mod1Mask, Button3);
restack_view(v);
- update_view_label(v);
- draw_bar();
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
draw_client(c);
@@ -354,10 +352,8 @@ manage_client(Client *c)
v = view.size ? view.data[sel] : alloc_view(def.tag);
if(!c->ntag) {
- for(i = 0; i < v->ntag; i++) {
- cext_strlcpy(c->tag[i], v->tag[i], sizeof(c->tag[i]));
- c->ntag++;
- }
+ cext_strlcpy(c->tag[0], v->name, sizeof(c->tag[0]));
+ c->ntag++;
}
update_tags();
diff --git a/cmd/wm/tag.c b/cmd/wm/tag.c
@@ -21,16 +21,7 @@ istag(char *t)
static void
organize_client(View *v, Client *c)
{
- unsigned int i;
- Bool hastag = False;
-
- for(i = 0; i < v->ntag; i++) {
- if(clienthastag(c, v->tag[i]))
- hastag = True;
- break;
- }
-
- if(hastag) {
+ if(clienthastag(c, v->name)) {
if(!clientofview(v, c)) {
/*fprintf(stderr, "org attach %s?\n", c->name);*/
attach_toview(v, c);
diff --git a/cmd/wm/view.c b/cmd/wm/view.c
@@ -21,7 +21,7 @@ alloc_view(char *name)
View *v = cext_emallocz(sizeof(View));
v->id = id++;
- v->ntag = str2tags(v->tag, name);
+ cext_strlcpy(v->name, name, sizeof(v->name));
alloc_area(v);
alloc_area(v);
sel = view.size;
@@ -69,7 +69,6 @@ focus_view(View *v)
{
Client *c;
unsigned int i;
- char vname[256];
/* cleanup other empty views */
for(i = 0; i < view.size; i++)
@@ -81,8 +80,7 @@ focus_view(View *v)
XGrabServer(dpy);
sel = view2index(v);
- tags2str(vname, sizeof(vname), v->tag, v->ntag);
- cext_strlcpy(def.tag, vname, sizeof(def.tag));
+ cext_strlcpy(def.tag, v->name, sizeof(def.tag));
update_frame_selectors(v);
@@ -152,42 +150,33 @@ View *
name2view(char *name)
{
View *v = nil;
- char vname[256];
unsigned int i;
- for(i = 0; i < view.size; i++) {
- v = view.data[i];
- tags2str(vname, sizeof(vname), v->tag, v->ntag);
- if(!strncmp(vname, name, strlen(name)))
+ for(i = 0; i < view.size; i++)
+ if(!strncmp(view.data[i]->name, name, strlen(name)))
return v;
- }
-
return nil;
}
View *
get_view(char *name)
{
- unsigned int i, j, ntags;
+ unsigned int i;
View *v = name2view(name);
- char tags[MAX_TAGS][MAX_TAGLEN];
if(v)
return v;
- ntags = str2tags(tags, name);
for(i = 0; i < client.size; i++)
- for(j = 0; j < ntags; j++)
- if(clienthastag(client.data[i], tags[j]))
- goto Createview;
+ if(clienthastag(client.data[i], name))
+ goto Createview;
return nil;
Createview:
v = alloc_view(name);
for(i = 0; i < client.size; i++)
- for(j = 0; j < ntags; j++)
- if(clienthastag(client.data[i], tags[j]) && !clientofview(v, client.data[i]))
- attach_toview(v, client.data[i]);
+ if(clienthastag(client.data[i], name) && !clientofview(v, client.data[i]))
+ attach_toview(v, client.data[i]);
return v;
}
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -75,8 +75,7 @@ typedef struct Client Client;
VECTOR(AreaVector, Area *);
struct View {
- char tag[MAX_TAGS][MAX_TAGLEN];
- unsigned int ntag;
+ char name[MAX_TAGLEN];
unsigned short id;
AreaVector area;
unsigned int sel;
@@ -143,7 +142,7 @@ typedef struct {
typedef struct {
char selcolor[24];
char normcolor[24];
- char tag[256];
+ char tag[MAX_TAGLEN];
char *font;
Color sel;
Color norm;
@@ -217,7 +216,6 @@ unsigned int bar_height();
Label *name2label(const char *name);
int label2index(Label *l);
void update_bar_tags();
-void update_view_label(View *v);
/* client.c */
Client *alloc_client(Window w, XWindowAttributes *wa);