From bd66e70aba959b6d1d6d70057a111f7f6df43cf4 Mon Sep 17 00:00:00 2001 From: garbeam Date: Thu, 8 Dec 2005 21:29:15 +0200 Subject: [PATCH] fixed several page selection issues --- cmd/wm/wm.c | 12 +++++------- rc/wmirc | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c index 383f5f1d..2a3f78f4 100644 --- a/cmd/wm/wm.c +++ b/cmd/wm/wm.c @@ -226,10 +226,8 @@ static int handle_kpress(XKeyEvent * e) { KeySym ksym = XKeycodeToKeysym(dpy, e->keycode, 0); - if (ksym >= XK_1 && ksym <= XK_9) - return ksym - XK_1; - else if (ksym == XK_0) - return 9; + if (ksym >= XK_0 && ksym <= XK_9) + return ksym - XK_0; else if (ksym >= XK_a && ksym <= XK_z) return 10 + ksym - XK_a; @@ -407,9 +405,9 @@ static void _select_page(void *obj, char *cmd) if (!p || !cmd) return; if (!strncmp(cmd, "prev", 5)) - p = cext_stack_get_up_item(&pages, p); + p = cext_list_get_prev_item(&pages, p); else if (!strncmp(cmd, "next", 5)) - p = cext_stack_get_down_item(&pages, p); + p = cext_list_get_next_item(&pages, p); else p = cext_list_get_item(&pages, _strtonum(cmd, 0, cext_sizeof(&pages) - 1)); sel_page(p); @@ -426,7 +424,7 @@ static void new_page(void *obj, char *cmd) { Page *p = get_sel_page(); if (p) - destroy_page(p); + hide_page(p); alloc_page(); } diff --git a/rc/wmirc b/rc/wmirc index 22804513..a2029a38 100644 --- a/rc/wmirc +++ b/rc/wmirc @@ -167,8 +167,7 @@ kbind normal $MODKEY-S-$SOUTHKEY 'wmir write /wm/sel/a/sel/f/sel/ctl ''select ne kbind normal $MODKEY-S-$NORTHKEY 'wmir write /wm/sel/a/sel/f/sel/ctl ''select prev''' kbind normal $MODKEY-space 'wmir write /wm/sel/ctl ''select toggled''' kbind normal $MODKEY-S-p 'wmir write /wm/ctl pager' -kbind normal $MODKEY-S-0 'wmir write /wm/ctl ''select 10''' -for(i in 1 2 3 4 5 6 7 8 9) { +for(i in 0 1 2 3 4 5 6 7 8 9) { kbind normal $MODKEY-S-$i 'wmir write /wm/ctl ''select '^$i^'''' }