commit a2a98ce85884bf5aea6d95e8fc4c8d43e6a87691
parent 81ee3de5fe5fd7db1119e0fdead9a3fac83a7e40
Author: garbeam <garbeam@mmv.wmii.de>
Date: Sun, 11 Dec 2005 19:14:06 +0200
fixed east/west selection in column layout
Diffstat:
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git 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);