implemented cmd 'sendto <page>' in /x/x/x/ctl

This commit is contained in:
Anselm R. Garbe 2006-02-23 20:52:55 +01:00
parent 33ffed7293
commit b3e54e3ae0
3 changed files with 23 additions and 2 deletions

View File

@ -584,3 +584,23 @@ select_client(Client *c, char *arg)
}
focus_client(a->client[i], True);
}
void
send_client(Client *c, char *arg) {
const char *errstr;
Page *p;
int i;
if(!strncmp(arg, "new", 4))
p = alloc_page();
else {
i = cext_strtonum(arg, 1, npage, &errstr);
if(errstr)
return;
p = page[i - 1];
}
detach_client(c, False);
focus_page(p);
attach_client(c);
}

View File

@ -1075,8 +1075,8 @@ xwrite(IXPConn *c, Fcall *fcall)
cl = page[i1]->area[i2]->client[i3];
if(!strncmp(buf, "kill", 5))
kill_client(cl);
if(!strncmp(buf, "detach", 7))
detach_client(cl, False);
if(!strncmp(buf, "sendto ", 7))
send_client(cl, &buf[7]);
break;
default:
break;

View File

@ -224,6 +224,7 @@ unsigned int bar_height(Client *c);
int cid_to_index(Area *a, unsigned short id);
int client_to_index(Client *c);
void select_client(Client *c, char *arg);
void send_client(Client *c, char *arg);
/* event.c */
void init_x_event_handler();