Added LeftBarClick and RightBarClick events. Fixed bar initialization (this is ugly)

This commit is contained in:
Kris Maglione 2006-06-21 17:12:02 -04:00
parent 645f3102df
commit ec4dc189f4
2 changed files with 20 additions and 4 deletions

View File

@ -75,7 +75,14 @@ handle_buttonrelease(XEvent *e)
if(ev->window == barwin) {
for(b=lbar; b; b=b->next)
if(ispointinrect(ev->x, ev->y, &b->bar->rect)) {
snprintf(buf, sizeof(buf), "BarClick %s %d\n",
snprintf(buf, sizeof(buf), "LeftBarClick %s %d\n",
b->name, ev->button);
write_event(buf);
return;
}
for(b=rbar; b; b=b->next)
if(ispointinrect(ev->x, ev->y, &b->bar->rect)) {
snprintf(buf, sizeof(buf), "RightBarClick %s %d\n",
b->name, ev->button);
write_event(buf);
return;

View File

@ -105,16 +105,25 @@ $MODKEY-Shift-9
EOF
# TAG BAR
IFS='
'
for bar in `wmiir ls /lbar`
do
wmiir rm /lbar/$bar
done
seltag=`wmiir read /tag/sel/ctl`
for tag in `wmiir ls /tag | sed -e 's,/$,,; /^sel$/d'`
do
wmiir create /lbar/$tag
if [ "X$tag" = "X$seltag" ]; then
xwrite "/lbar/$tag" $WMII_SELCOLORS $tag
xwrite /lbar/$tag $WMII_SELCOLORS $tag
else
xwrite "/lbar/$tag" $WMII_NORMCOLORS $tag
xwrite /lbar/$tag $WMII_NORMCOLORS $tag
fi
done
IFS=
# EVENT LOOP
wmiir read /event 2>/dev/null |
@ -144,7 +153,7 @@ do
UnfocusTag)
xwrite /lbar/$1 $WMII_NORMCOLORS $1
;;
BarClick)
LeftBarClick)
xwrite /ctl view "$1";;
Key)
case "$1" in