~foura/wired

1b8752f7adc9f4faa6210eba9d914a2a44e5f1db — james palmer 10 months ago 6f2fd55 front
bring in line with libacme changes to event handling
1 files changed, 12 insertions(+), 13 deletions(-)

M main.c
M main.c => main.c +12 -13
@@ 77,18 77,10 @@ eventproc(void *aux)

	win = aux;
	events = win->aux;
	win->eventfd = awinfsopen(win, "event", ORDWR);
	aeventopen(win);

	while(aeventnext(win, &ev)) {
		switch(ev.type) {
		case 'L':
		case 'l':
			aeventsend(win, &ev);
			break;
		default:
			send(events, &ev);
		}
	}
	while(aeventread(win, &ev))
		send(events, &ev);

	threadexits(nil);
}


@@ 235,14 227,21 @@ threadmain(int argc, char *argv[])

	while(recv(events, &ev)) {
		switch(ev.type) {
		case 'l':
		case 'L':
			aeventwrite(ev.win, &ev);
			break;

		case 'x':
		case 'X':
			if(strcmp(ev.text, "Del") == 0)
				goto quit;
			if(strcmp(ev.text, "Send") == 0)
			else if(strcmp(ev.text, "Send") == 0)
				sendmessage(input);
			if(strcmp(ev.text, "Act") == 0)
			else if(strcmp(ev.text, "Act") == 0)
				sendaction(input);
			else
				aeventwrite(ev.win, &ev);

			break;
		case 'I':