several fixes

This commit is contained in:
Anselm R. Garbe 2006-03-27 11:55:41 +02:00
parent ae89ad3d79
commit 193dbc69fc
4 changed files with 13 additions and 8 deletions

View File

@ -29,7 +29,7 @@ comp_label_name(const void *l1, const void *l2)
}
Label *
get_label(char *name)
get_label(char *name, Bool intern)
{
static unsigned int id = 1;
Label *l = name2label(name);
@ -38,6 +38,7 @@ get_label(char *name)
return l;
l = cext_emallocz(sizeof(Label));
l->id = id++;
l->intern = intern;
cext_strlcpy(l->name, name, sizeof(l->name));
cext_strlcpy(l->colstr, def.selcolor, sizeof(l->colstr));
l->color = def.sel;
@ -210,15 +211,13 @@ update_bar_tags()
}
}
for(i = 0; i < ntag; i++) {
l = get_label(tag[i]);
l->intern = True;
l = get_label(tag[i], True);
cext_strlcpy(l->data, tag[i], sizeof(l->data));
}
for(i = 0; i < nview; i++) {
View *v = view[i];
tags2str(vname, sizeof(vname), v->tag, v->ntag);
l = get_label(vname);
l->intern = True;
l = get_label(vname, True);
cext_strlcpy(l->data, vname, sizeof(l->data));
}
draw_bar();

View File

@ -635,7 +635,7 @@ xcreate(IXPConn *c, Fcall *fcall)
type = qpath_type(m->qid.path);
switch(type) {
case FsDbar:
get_label(fcall->name);
get_label(fcall->name, False);
break;
default:
return Enofile;

View File

@ -213,7 +213,7 @@ char *mode2str(int mode);
Bool clientofarea(Area *a, Client *c);
/* bar.c */
Label *get_label(char *name);
Label *get_label(char *name, Bool intern);
void destroy_label(Label *l);
void draw_bar();
int lid2index(unsigned short id);

View File

@ -48,13 +48,15 @@ $MODKEY-Control-q,y
$MODKEY-Control-p
$MODKEY-Control-a
$MODKEY-Control-t
$MODKEY-t
$MODKEY-Control-h
$MODKEY-Control-l
$MODKEY-Shift-h
$MODKEY-Shift-l
$MODKEY-Shift-j
$MODKEY-Shift-k
$MODKEY-space
$MODKEY-Shift-space
$MODKEY-t
$MODKEY-h
$MODKEY-l
$MODKEY-j
@ -122,6 +124,10 @@ do
xwrite /view/sel/mode equal;;
$MODKEY-n)
xwrite /view/sel/sel/ctl sendto new;;
$MODKEY-Control-h)
xwrite /view/sel/sel/ctl sendto prev;;
$MODKEY-Control-l)
xwrite /view/sel/sel/ctl sendto next;;
$MODKEY-Shift-h)
xwrite /view/sel/sel/ctl swap prev;;
$MODKEY-Shift-l)