From e1e97212d511d03170747ec175f493d77d89246e Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Fri, 9 Dec 2011 01:24:48 +0200 Subject: work on move_{up,down}() functions --- dminiwm.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'dminiwm.c') diff --git a/dminiwm.c b/dminiwm.c index 59a0f07..39b10fb 100644 --- a/dminiwm.c +++ b/dminiwm.c @@ -268,29 +268,27 @@ void prev_win(const Arg arg) { } void move_down(const Arg arg) { - Window tmp; - if(current == NULL || current->next == NULL || current->win == head->win || current->prev == NULL) + if(current == NULL || current == head || current->next == NULL) return; - - tmp = current->win; + Window tmpwin = current->win; current->win = current->next->win; - current->next->win = tmp; - next_win((Arg){NULL}); + current->next->win = tmpwin; + current = current->next; save_desktop(current_desktop); tile(); + update_current(); } void move_up(const Arg arg) { - Window tmp; - if(current == NULL || current->prev == head || current->win == head->win) { + if(current == NULL || current == head || current->prev == head) return; - } - tmp = current->win; + Window tmpwin = current->win; current->win = current->prev->win; - current->prev->win = tmp; - prev_win((Arg){NULL}); + current->prev->win = tmpwin; + current = current->prev; save_desktop(current_desktop); tile(); + update_current(); } void swap_master(const Arg arg) { -- cgit v1.3.1