arrange on old_screen, not on event screen

This commit is contained in:
Julien Danjou 2007-10-01 12:46:59 +02:00
parent 47ec01e571
commit 6e4942711f
1 changed files with 9 additions and 8 deletions

View File

@ -227,22 +227,23 @@ uicb_movetoscreen(Display *disp,
awesome_config * awesomeconf,
const char *arg)
{
int screen;
int new_screen, prev_screen;
if(!XineramaIsActive(disp) || !sel)
return;
if(arg)
{
screen = strtol(arg, NULL, 10);
if(screen >= get_screen_count(disp) || screen < 0)
new_screen = strtol(arg, NULL, 10);
if(new_screen >= get_screen_count(disp) || new_screen < 0)
return;
}
else
screen = sel->screen + 1 >= get_screen_count(disp) ? 0 : sel->screen + 1;
new_screen = sel->screen + 1 >= get_screen_count(disp) ? 0 : sel->screen + 1;
move_client_to_screen(sel, &awesomeconf[screen - awesomeconf->screen], True);
move_mouse_pointer_to_screen(disp, screen);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, &drawcontext[screen - awesomeconf->screen], &awesomeconf[screen - awesomeconf->screen]);
prev_screen = sel->screen;
move_client_to_screen(sel, &awesomeconf[new_screen - awesomeconf->screen], True);
move_mouse_pointer_to_screen(disp, new_screen);
arrange(disp, drawcontext, &awesomeconf[prev_screen - awesomeconf->screen]);
arrange(disp, &drawcontext[new_screen - awesomeconf->screen], &awesomeconf[new_screen - awesomeconf->screen]);
}