better between-screen-moving handling, and allow for live re-arrange()-ing
This commit is contained in:
parent
6ab7121c49
commit
4270d8bba6
37
mouse.c
37
mouse.c
|
@ -79,22 +79,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
switch (ev.type)
|
switch (ev.type)
|
||||||
{
|
{
|
||||||
case ButtonRelease:
|
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);
|
XUngrabPointer(globalconf.display, CurrentTime);
|
||||||
return;
|
return;
|
||||||
case ConfigureRequest:
|
case ConfigureRequest:
|
||||||
|
@ -129,6 +113,27 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
client_resize(c, geometry, False);
|
client_resize(c, geometry, False);
|
||||||
while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev));
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue