better between-screen-moving handling, and allow for live re-arrange()-ing

This commit is contained in:
Julien Danjou 2008-01-28 11:32:55 +01:00
parent 6ab7121c49
commit 4270d8bba6
1 changed files with 21 additions and 16 deletions

37
mouse.c
View File

@ -79,22 +79,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
switch (ev.type)
{
case ButtonRelease:
if(!c->isfloating && layout->arrange != layout_floating)
{
XQueryPointer(globalconf.display, RootWindow(globalconf.display, phys_screen),
&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)
{
client_list_swap(&globalconf.clients, c, target);
globalconf.screens[screen].need_arrange = True;
}
}
XUngrabPointer(globalconf.display, CurrentTime);
return;
case ConfigureRequest:
@ -129,6 +113,27 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
client_resize(c, geometry, False);
while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev));
}
else
{
XQueryPointer(globalconf.display,
RootWindow(globalconf.display, phys_screen),
&dummy, &child, &x, &y, &di, &di, &dui);
if((newscreen = get_screen_bycoord(x, y)) != c->screen)
{
move_client_to_screen(c, newscreen, True);
globalconf.screens[c->screen].need_arrange = True;
globalconf.screens[newscreen].need_arrange = True;
layout_refresh();
}
if((target = get_client_bywin(globalconf.clients, child))
&& target != c)
{
printf("swapping 0x%x 0x%d [%s] [%s]\n", c, target, c->name, target->name);
client_list_swap(&globalconf.clients, c, target);
globalconf.screens[c->screen].need_arrange = True;
layout_refresh();
}
}
break;
}
}