Re: [dwm] some useful changes

From: Enno \ <gottox_AT_gmail.com>
Date: Mon, 27 Nov 2006 17:53:16 +0100

Hi!

This looks like a cleaner solution to me. The only disadvantage is,
that dwm tests all keydefs. A little overhead, but this is not too bad
in my eyes.

Grusz
Enno Boland

2006/11/27, Alex Elide <elide_AT_bk.ru>:
> On Mon, Nov 27, 2006 at 05:31:14PM +0100, Anselm R. Garbe wrote:
> > On Mon, Nov 27, 2006 at 02:17:07PM +0100, Sander van Dijk wrote:
> > > On 11/27/06, Enno Gottox Boland <gottox_AT_gmail.com> wrote:
> > > >I think this change make the whole configuration more weird. I never
> > > >used more than one function per key.
> > >
> > > I agree with the "more weird" part, it makes config.h less intuitive;
> > > writing a wrapper function really isn't that hard (people who don't
> > > know enough C to do that, probably will be confused by this
> > > configuration approach as well). I somehow find this approach to be
> > > below par compared to the rest of dwm.
> >
> > What do others think about the change?
> > Anyone likes the change? If not, I'd consider removing it
> > again...
> >
> > Regards,
> > --
> > Anselm R. Garbe >< http://suckless.org/~arg/ >< GPG key: 0D73F361
> ---end quoted text---
>
> I've just removed return statement in keypress handler.
>
> diff -r 70472540c443 event.c
> --- a/event.c Sun Nov 26 15:43:16 2006 +0100
> +++ b/event.c Sun Nov 26 20:51:46 2006 +0300
> @@ -256,7 +231,6 @@ keypress(XEvent *e) {
> {
> if(key[i].func)
> key[i].func(&key[i].arg);
> - return;
> }
> }
> }
>
> so, I can write
>
> static Key key[] = { \
> /* skipped */ \
> { ctrl, XK_1, tag, { .i = 0 } }, \
> { ctrl, XK_1, view, { .i = 0 } }, \
> { ctrl, XK_2, tag, { .i = 1 } }, \
> { ctrl, XK_2, view, { .i = 1 } }, \
> /* skipped */ \
> };
>
> in my config.h and it works fine for me.
>
> wbr, elide.
>
>

-- 
http://www.gnuffy.org - Real Community Distro
http://www.gnuffy.org/index.php/GnuEm - Gnuffy on Ipaq (Codename Peggy)
Received on Mon Nov 27 2006 - 17:53:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:32:51 UTC