diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-09 00:52:10 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2011-12-09 01:23:19 +0200 |
| commit | 2881263660afb236f24fa32d943dc5d5f762c6c9 (patch) | |
| tree | 71e8a2f39d7f63d3cc3e05500d4022f5317d3e17 /dminiwm.c | |
| parent | 5a314d02667acf28d83d7c8af60cea278b85e157 (diff) | |
work on swap_master() function
Diffstat (limited to 'dminiwm.c')
| -rw-r--r-- | dminiwm.c | 27 |
1 files changed, 10 insertions, 17 deletions
@@ -294,23 +294,16 @@ void move_up(const Arg arg) { } void swap_master(const Arg arg) { - Window tmp; - - if(head->next != NULL && current != NULL && mode != MONOCYCLE) { - if(current == head) { - tmp = head->next->win; - head->next->win = head->win; - head->win = tmp; - } else { - tmp = head->win; - head->win = current->win; - current->win = tmp; - current = head; - } - save_desktop(current_desktop); - tile(); - update_current(); - } + if(head->next == NULL || current == NULL || mode == MONOCYCLE) + return; + Window tmpwin = head->win; + current = (current == head) ? head->next : current; + head->win = current->win; + current->win = tmpwin; + current = head; + save_desktop(current_desktop); + tile(); + update_current(); } /* **************************** Desktop Management ************************************* */ |
