Fix 'send_to_monitor'

This commit is contained in:
Bastien Dejean 2012-10-17 18:54:32 +02:00
parent 2a3362fc4b
commit e771dd4c90
2 changed files with 7 additions and 5 deletions

View file

@ -128,6 +128,9 @@ The following messages are handled:
magnetise COR
Move all the fences toward the given corner.
send_to_monitor MONITOR_NAME
Send the focused window to the given monitor.
send_to DESKTOP_NAME
Send the focused window to the given desktop.

View file

@ -129,11 +129,10 @@ void process_message(char *msg, char *rsp)
} else if (strcmp(cmd, "send_to_monitor") == 0) {
char *name = strtok(NULL, TOKEN_SEP);
if (name != NULL) {
desktop_location_t loc;
if (locate_desktop(name, &loc)) {
transfer_node(mon, mon->desk, loc.monitor, loc.desktop, mon->desk->focus);
if (mon != loc.monitor && loc.monitor->desk == loc.desktop)
arrange(loc.monitor, loc.desktop);
monitor_t *m = find_monitor(name);
if (m != NULL && m != mon) {
transfer_node(mon, mon->desk, m, m->desk, mon->desk->focus);
arrange(m, m->desk);
}
}
} else if (strcmp(cmd, "send_to") == 0) {