handle screen changes

This commit is contained in:
Julien Danjou 2008-01-28 11:03:19 +01:00
parent a73d635146
commit 914e908aa8
1 changed files with 7 additions and 1 deletions

View File

@ -42,7 +42,7 @@ extern AwesomeConf globalconf;
void void
uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
{ {
int x, y, ocx, ocy, di, phys_screen; int x, y, ocx, ocy, di, phys_screen, newscreen;
unsigned int dui; unsigned int dui;
Window dummy, child; Window dummy, child;
XEvent ev; XEvent ev;
@ -83,6 +83,12 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
{ {
XQueryPointer(globalconf.display, RootWindow(globalconf.display, phys_screen), XQueryPointer(globalconf.display, RootWindow(globalconf.display, phys_screen),
&dummy, &child, &x, &y, &di, &di, &dui); &dummy, &child, &x, &y, &di, &di, &dui);
if((newscreen = get_screen_bycoord(x, y)) != screen)
{
move_client_to_screen(c, newscreen, True);
globalconf.screens[screen].need_arrange = True;
globalconf.screens[newscreen].need_arrange = True;
}
if((target = get_client_bywin(globalconf.clients, child)) && target != c) if((target = get_client_bywin(globalconf.clients, child)) && target != c)
{ {
client_list_swap(&globalconf.clients, c, target); client_list_swap(&globalconf.clients, c, target);