From ba58d5e94be4e402f08ab8902e3fab3b689da2b2 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 5 Oct 2007 16:58:28 +0200 Subject: [PATCH] movetoscreen works with +/- and cycle --- screen.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/screen.c b/screen.c index c21a1d9b..e08b1afa 100644 --- a/screen.c +++ b/screen.c @@ -240,17 +240,18 @@ uicb_movetoscreen(Display *disp, { int new_screen, prev_screen; - if(!XineramaIsActive(disp) || !sel) + if(!sel || !XineramaIsActive(disp)) return; if(arg) - { - new_screen = strtol(arg, NULL, 10); - if(new_screen >= get_screen_count(disp) || new_screen < 0) - return; - } + new_screen = compute_value_from_arg(arg, sel->screen); 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; move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True);