aboutsummaryrefslogtreecommitdiff
path: root/dminiwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 19:41:21 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 19:41:21 +0200
commit43146fd86cca51623e788252ccd4f09c81e958b8 (patch)
tree95a928b69e9adc04f372731ec265bd81f6cac6ef /dminiwm.c
parente3124ab1ed785db319492fdf7b573f503f7aedd0 (diff)
do not try next or prev window if no other window is open
Diffstat (limited to 'dminiwm.c')
-rw-r--r--dminiwm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dminiwm.c b/dminiwm.c
index 91cdc2d..dc310c0 100644
--- a/dminiwm.c
+++ b/dminiwm.c
@@ -220,13 +220,13 @@ void killclient() {
}
void next_win() {
- if(current == NULL || head == NULL) return;
+ if(current == NULL || head == NULL || (current == head && current->next == NULL)) return;
current = (current->next == NULL) ? head : current->next;
update_current();
}
void prev_win() {
- if(current == NULL || head == NULL) return;
+ if(current == NULL || head == NULL || (current == head && current->next == NULL)) return;
if(current->prev == NULL) /* if(current == head) */
for(current=head; current->next; current=current->next);
else