From b26a8fbbb6d332c0da8bbfce89eb2fbda6e606eb Mon Sep 17 00:00:00 2001 From: james palmer Date: Mon, 19 Jul 2021 17:56:44 +0000 Subject: [PATCH] events: store source window in AEvent struct. this allows a program to return the event to the source window given only the AEvent struct. in a multithreaded program this allows a program to delegate event processing to one thread for all windows. --- acme.h | 2 ++ event.c | 1 + 2 files changed, 3 insertions(+) diff --git a/acme.h b/acme.h index 480410d..64b3207 100644 --- a/acme.h +++ b/acme.h @@ -26,6 +26,8 @@ struct AWin { }; struct AEvent { + AWin *win; + char origin; char type; diff --git a/event.c b/event.c index de534ea..5242e19 100644 --- a/event.c +++ b/event.c @@ -84,6 +84,7 @@ aeventnext(AWin *w, AEvent *e) flags = 0; loop: + e->win = w; e->origin = getc(w); e->type = getc(w); e->q0 = getnum(w); -- 2.34.2