From ec4dc189f4bc94221585127205af0f25f7261c62 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 21 Jun 2006 17:12:02 -0400 Subject: [PATCH] Added LeftBarClick and RightBarClick events. Fixed bar initialization (this is ugly) --- cmd/wm/event.c | 9 ++++++++- rc/wmiirc | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cmd/wm/event.c b/cmd/wm/event.c index c8c36b55..024c82b2 100644 --- 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 index 551b94bb..712c5578 100644 --- 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