From 0792d6c5acff7ccfa11eda74c0756c1931259ab3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 5 Oct 2007 13:52:38 +0200 Subject: [PATCH] bugfix: allow cycling back in uicb_setlayout() --- layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layout.c b/layout.c index 6bbd097f..29e023b9 100644 --- a/layout.c +++ b/layout.c @@ -175,8 +175,10 @@ uicb_setlayout(Display *disp, { for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++); i = compute_new_value_from_arg(arg, (double) i); - if(i < 0 || i >= awesomeconf->nlayouts) + if(i >= awesomeconf->nlayouts) i = 0; + else if(i < 0) + i = awesomeconf->nlayouts - 1; } else i = 0;