diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-09 01:24:48 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-09 01:27:14 +0200 |
| commit | e1e97212d511d03170747ec175f493d77d89246e (patch) | |
| tree | 83f91d5a6ea1596a714211fb00c384595d8d49a0 | |
| parent | 2881263660afb236f24fa32d943dc5d5f762c6c9 (diff) | |
work on move_{up,down}() functions
| -rw-r--r-- | dminiwm.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -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) { |
