From 77b2a76e3bf966b295509725aba661f6a813caf4 Mon Sep 17 00:00:00 2001 From: Albert Graef Date: Mon, 4 Mar 2024 04:46:23 +0100 Subject: [PATCH] Another fix for Purr Data compatibility. We need to disable the custom widget behavior of the gfx API there since it interferes with Purr Data's own event handling. --- pdlua.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdlua.c b/pdlua.c index db9b4d2..7ae8f38 100644 --- a/pdlua.c +++ b/pdlua.c @@ -1097,7 +1097,13 @@ static int pdlua_class_new(lua_State *L) #if PLUGDATA plugdata_register_class(name); #endif - + +#ifndef PURR_DATA + /* Vanilla Pd and plugdata require this for the gfx routines, but this + interferes with Purr Data's handling of canvas events and is thus + disabled there. XXXTODO: When we add the gfx API in Purr Data, we'll + have to figure out how to tie into Purr Data's JavaScript GUI in order + to implement these callbacks. -ag */ // Set custom widgetbehaviour for GUIs pdlua_widgetbehavior.w_getrectfn = pdlua_getrect; pdlua_widgetbehavior.w_displacefn = pdlua_displace; @@ -1107,6 +1113,7 @@ static int pdlua_class_new(lua_State *L) pdlua_widgetbehavior.w_visfn = pdlua_vis; pdlua_widgetbehavior.w_activatefn = pdlua_activate; class_setwidget(c, &pdlua_widgetbehavior); +#endif if (c) { /* a class with a "menu-open" method will have the "Open" item highlighted in the right-click menu */