diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index b77230834c6205dbd2353681319acfa3d70abf56..c1167d9d88c7ada30e0958a50fde3c3dd8a4a812 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -3008,6 +3008,8 @@ static double canvas_upclicktime; static int canvas_upx, canvas_upy; #define DCLICKINTERVAL 0.25 +extern t_class *my_canvas_class; // for ignoring runtime clicks + /* mouse click */ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, int mod, int doit) @@ -3120,8 +3122,8 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, if (canvas_hitbox(x, y, xpos, ypos, &x1, &y1, &x2, &y2)) { ob = pd_checkobject(&y->g_pd); - /* do not give clicks to comments during runtime */ - if (!ob || ob->te_type != T_TEXT) + /* do not give clicks to comments or cnv during runtime */ + if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) yclick = y; //fprintf(stderr," MAIN found clickable %d\n", // clickreturned); diff --git a/pd/src/g_graph.c b/pd/src/g_graph.c index aedca17310cb418cf8803e2cf65a6da268a7ba40..6c1b05bdf4290d1131845f0baf74df688c3a4040 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -1483,6 +1483,8 @@ static void graph_motion(void *z, t_floatarg dx, t_floatarg dy) garray_redraw(a); } +extern t_class *my_canvas_class; // for ignoring runtime clicks + static int graph_click(t_gobj *z, struct _glist *glist, int xpix, int ypix, int shift, int alt, int dbl, int doit) { @@ -1517,8 +1519,8 @@ static int graph_click(t_gobj *z, struct _glist *glist, if (canvas_hitbox(x, y, xpix, ypix, &x1, &y1, &x2, &y2)) { ob = pd_checkobject(&y->g_pd); - /* do not give clicks to comments during runtime */ - if (!ob || ob->te_type != T_TEXT) + /* do not give clicks to comments or cnv during runtime */ + if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) clickme = y; //fprintf(stderr," found clickable %d\n", clickreturned); }