...
 
Commits (2)
......@@ -699,7 +699,11 @@ movemouse(union arg arg)
/* check if it has been moved to another monitor */
mon = seat_locate_rectangle(seat, c->dim);
if (mon != seat->selmon) {
if (!mon) {
warn("Client has been moved offscreen, moving back");
/* "snap" client back into the monitor area*/
monitor_arrange(seat->selmon);
} else if (mon != seat->selmon) {
debug("Client has changed monitor, transferring");
workspace_detach_client(c->ws, c);
workspace_attach_client(mon->selws, c);
......@@ -1703,6 +1707,7 @@ updategeom(void)
if (!XineramaIsActive(x11.dpy)) {
while (seat->monitors->size > 1) {
mon = seat->monitors->elements[1];
monitor_show_workspace(mon, NULL);
seat_detach_monitor(seat, mon);
monitor_destroy(mon);
}
......
......@@ -15,7 +15,7 @@ rectangle_intersection(struct rectangle r1, struct rectangle r2)
int bottom = MIN(r1.y + (int signed) r1.height,
r2.y + (int signed) r2.height);
if (left > right || bottom > top)
if (left > right || top > bottom)
/* no intersection */
return 0;
......