From 0a9dd6d375e5dc050e092f411d21c74a124a64e8 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Thu, 22 Oct 2015 17:40:25 -0400
Subject: [PATCH] fix bug where [event] didn't work in subpatches

---
 pd/src/g_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pd/src/g_template.c b/pd/src/g_template.c
index fddd01ca0..f1da44448 100644
--- a/pd/src/g_template.c
+++ b/pd/src/g_template.c
@@ -4442,7 +4442,7 @@ static void *event_new(void)
 {
     char namebuf[20];
     t_event *x = (t_event *)pd_new(event_class);
-    t_canvas *c = canvas_getcurrent();
+    t_canvas *c = canvas_getrootfor(canvas_getcurrent());
     if (c->gl_vec)
     {
         sprintf(namebuf, "%lx_event", (long unsigned int)c->gl_vec);
-- 
GitLab