commit ec4dc189f4bc94221585127205af0f25f7261c62
parent 645f3102df1b981b3f76b015f557b5eb5a3cd90e
Author: Kris Maglione <bsdaemon@wmii.de>
Date: Wed, 21 Jun 2006 17:12:02 -0400
Added LeftBarClick and RightBarClick events. Fixed bar initialization (this is ugly)
Diffstat:
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/cmd/wm/event.c b/cmd/wm/event.c
@@ -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;
diff --git a/rc/wmiirc b/rc/wmiirc
@@ -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