bugfix: allow cycling back in uicb_setlayout()

This commit is contained in:
Julien Danjou 2007-10-05 13:52:38 +02:00
parent 9ec4e30a85
commit 0792d6c5ac
1 changed files with 3 additions and 1 deletions

View File

@ -175,8 +175,10 @@ uicb_setlayout(Display *disp,
{ {
for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++); for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++);
i = compute_new_value_from_arg(arg, (double) i); i = compute_new_value_from_arg(arg, (double) i);
if(i < 0 || i >= awesomeconf->nlayouts) if(i >= awesomeconf->nlayouts)
i = 0; i = 0;
else if(i < 0)
i = awesomeconf->nlayouts - 1;
} }
else else
i = 0; i = 0;