diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c index c294e0287079bd4392d03994c59fdacc918ffb08..fc814ed0062e18d4bfd207014d18e655832cbcfd 100644 --- a/pd/src/g_editor.c +++ b/pd/src/g_editor.c @@ -3017,8 +3017,6 @@ 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) @@ -3131,8 +3129,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 or cnv during runtime */ - if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) + /* do not give clicks to comments during runtime */ + if (!ob || ob->te_type != T_TEXT) 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 6c1b05bdf4290d1131845f0baf74df688c3a4040..0a62b4c759b92205aac8879de01321faa131bf4d 100644 --- a/pd/src/g_graph.c +++ b/pd/src/g_graph.c @@ -1483,8 +1483,6 @@ 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) { @@ -1519,8 +1517,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 or cnv during runtime */ - if (!ob || (ob->te_type != T_TEXT && ob->ob_pd != my_canvas_class)) + /* do not give clicks to comments during runtime */ + if (!ob || ob->te_type != T_TEXT) clickme = y; //fprintf(stderr," found clickable %d\n", clickreturned); } diff --git a/pd/src/g_mycanvas.c b/pd/src/g_mycanvas.c index bd05bd5e66b606c28ec1b2986b266156403ec515..c3254df71a4f95cff18f815fbec523005f510644 100644 --- a/pd/src/g_mycanvas.c +++ b/pd/src/g_mycanvas.c @@ -149,9 +149,10 @@ static void my_canvas_getrect(t_gobj *z, t_glist *glist, *xp1 = text_xpix(&x->x_gui.x_obj, glist); *yp1 = text_ypix(&x->x_gui.x_obj, glist); - if (!glist_istoplevel(glist)) + if (!glist_istoplevel(glist) || !glist->gl_edit) { //if we are trying to calculate visibility of a widget inside a GOP + //or are calculating getrect during runtime *xp2 = *xp1 + x->x_vis_w; *yp2 = *yp1 + x->x_vis_h; }