[wmii] Re: BUG: Event spelled wrong in wmiirc

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Tue, 2 May 2006 10:02:49 +0200

On Mon, May 01, 2006 at 10:22:02PM -0700, Billy He wrote:
> I'm using wmii-20060501-rc1, however I think this has been a bug for a
> while. The reason no one notice it is because it "still works", mostly
> thanks to X11.
> in wmiirc, one of the case specofoced for the event type is "BarClick",
> it should be "ClientClick". The reason it still "sort of" works even
> wrongly spelled is baecause if wmii is not handling the click event, X11
> will still have catch it and raised the window.
> By changing the "BarClick" in wmiirc to "ClientClick" allows to more
> flexible clicking event handling such as:
> ClientClick)
> case "$2" in
> 1)
> xwrite /ctl view "$1";;
> 2)
> xwrite /view/sel/sel/ctl kill;;
> 4)
> xwrite /view/sel/sel/ctl sendto prev;;
> 5)
> xwrite /view/sel/sel/ctl sendto next;;
> esac;;
> I hope the bug gets fixed soon.

I think you misinterpreted something. The BarClick handling in
default wmiirc is totally correct, the wmiiwm(1)

       BarClick <label> <button>
                This event is reported whenever a label in the
                bar has been clicked. The <label> argument
                contains the name of the label in the /bar
                namespace. The <button> argument contains the
                mouse button index which has been pressed
                during the click, e.g. 1, if it has been the
                left mouse button.

       ClientClick <index> <button>
               This event is reported whenever a client frame
               has been clicked. The <index> argument
               represents this client in the /client namespace.
               The <button> argument contains the mouse button
               index which has been pressed during the click,
               e.g. 1, if it has been the left mouse button.

During the fact, that labels of views in the bar have the same
name as the view, the BarClick event is used for view selection
from the bar. Your patch above would break that and randomly
work correct and incorrect, depending which views exist or not
and depending which client you left click on its bar.

The ClientClick event is _not_ handled by default, because the
kill on middle click seems not a proper choice in wmii-2.x, the
other ideas in your event handling might be of use for some
people, though I don't plan to add any defaults for this event.
It should be up to the user.

All in all, your patch should look as follows instead, to be

                 xwrite /ctl view "$1";;
                 case "$2" in
                         xwrite /view/sel/sel/ctl kill;;
                         xwrite /view/sel/sel/ctl sendto prev;;
                         xwrite /view/sel/sel/ctl sendto next;;


 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Tue May 02 2006 - 10:02:49 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:04:09 UTC