movetoscreen works with +/- and cycle

This commit is contained in:
Julien Danjou 2007-10-05 16:58:28 +02:00
parent 0792d6c5ac
commit ba58d5e94b
1 changed files with 8 additions and 7 deletions

View File

@ -240,17 +240,18 @@ uicb_movetoscreen(Display *disp,
{ {
int new_screen, prev_screen; int new_screen, prev_screen;
if(!XineramaIsActive(disp) || !sel) if(!sel || !XineramaIsActive(disp))
return; return;
if(arg) if(arg)
{ new_screen = compute_value_from_arg(arg, sel->screen);
new_screen = strtol(arg, NULL, 10);
if(new_screen >= get_screen_count(disp) || new_screen < 0)
return;
}
else else
new_screen = sel->screen + 1 >= get_screen_count(disp) ? 0 : sel->screen + 1; new_screen = sel->screen + 1;
if(new_screen >= get_screen_count(disp))
new_screen = 0;
else if(new_screen < 0)
new_screen = get_screen_count(disp) - 1;
prev_screen = sel->screen; prev_screen = sel->screen;
move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True); move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True);