From a2a98ce85884bf5aea6d95e8fc4c8d43e6a87691 Mon Sep 17 00:00:00 2001 From: garbeam Date: Sun, 11 Dec 2005 19:14:06 +0200 Subject: [PATCH] fixed east/west selection in column layout --- cmd/wm/layout_column.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/wm/layout_column.c b/cmd/wm/layout_column.c index a8679aa8..760322f1 100644 --- a/cmd/wm/layout_column.c +++ b/cmd/wm/layout_column.c @@ -321,13 +321,19 @@ static void select_frame(void *obj, char *arg) f = cext_list_get_prev_item(&col->frames, f); else if (!strncmp(arg, "next", 5)) f = cext_list_get_next_item(&col->frames, f); - else if (!strncmp(arg, "west", 5)) - f = cext_stack_get_top_item(&((Column *)cext_list_get_prev_item(&acme->columns, col))->frames); - else if (!strncmp(arg, "east", 5)) - f = cext_stack_get_top_item(&((Column *)cext_list_get_next_item(&acme->columns, col))->frames); + else if (!strncmp(arg, "west", 5)) { + col = cext_list_get_prev_item(&acme->columns, col); + cext_stack_top_item(&acme->columns, col); + f = cext_stack_get_top_item(&col->frames); + } + else if (!strncmp(arg, "east", 5)) { + col = cext_list_get_next_item(&acme->columns, col); + cext_stack_top_item(&acme->columns, col); + f = cext_stack_get_top_item(&col->frames); + } else f = cext_list_get_item(&col->frames, blitz_strtonum(arg, 0, cext_sizeof(&col->frames) - 1)); - if (old != f) { + if (f && old != f) { select_col(f, True); center_pointer(f); draw_frame(old, nil);