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

View File

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

View File

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

View File

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