add uicb_movetoscreen()

This commit is contained in:
Julien Danjou 2007-09-27 21:51:05 +02:00
parent ed4f0c20fe
commit ca363aa248
3 changed files with 28 additions and 0 deletions

View File

@ -115,6 +115,7 @@ static const NameFuncLink KeyfuncList[] = {
/* screen.c */
{"focusnextscreen", uicb_focusnextscreen},
{"focusprevscreen", uicb_focusprevscreen},
{"movetoscreen", uicb_movetoscreen},
/* awesome.c */
{"quit", uicb_quit},
/* statusbar.c */

View File

@ -187,3 +187,29 @@ uicb_focusprevscreen(Display *disp,
}
move_mouse_pointer_to_screen(disp, prev_screen);
}
void
uicb_movetoscreen(Display *disp,
DC *drawcontext,
awesome_config * awesomeconf,
const char *arg)
{
int screen;
if(!XineramaIsActive(disp) || !sel)
return;
if(arg)
{
screen = strtol(arg, NULL, 10);
if(screen >= get_screen_count(disp) || screen < 0)
return;
}
else
screen = sel->screen + 1 >= get_screen_count(disp) ? 0 : sel->screen + 1;
sel->screen = screen;
move_mouse_pointer_to_screen(disp, screen);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, &drawcontext[screen - awesomeconf->screen], &awesomeconf[screen - awesomeconf->screen]);
}

View File

@ -34,5 +34,6 @@ int get_screen_bycoord(Display *, int, int);
int get_screen_count(Display *);
UICB_PROTO(uicb_focusnextscreen);
UICB_PROTO(uicb_focusprevscreen);
UICB_PROTO(uicb_movetoscreen);
#endif