Commit eea40f66 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

use glist_isvisible to protect against sending messages to GUI before the relevant canvas exists

parent 777121c4
......@@ -690,7 +690,7 @@ void canvas_dirty(t_canvas *x, t_floatarg n)
if ((unsigned)n != x2->gl_dirty)
{
x2->gl_dirty = n;
if (x2->gl_havewindow) // was glist_isvisible(x2)
if (x2->gl_havewindow && glist_isvisible(x2))
canvas_reflecttitle(x2);
}
}
......
......@@ -7230,7 +7230,8 @@ void canvas_editmode(t_canvas *x, t_floatarg fyesplease)
//dpsaha@vt.edu called to delete the GOP_blob
if (x->gl_goprect) canvas_draw_gop_resize_hooks(x);
}
canvas_setcursor(x, CURSOR_RUNMODE_NOTHING);
if (glist_isvisible(x))
canvas_setcursor(x, CURSOR_RUNMODE_NOTHING);
}
if (glist_isvisible(x))
{
......
......@@ -1426,7 +1426,9 @@ static void graph_select(t_gobj *z, t_glist *glist, int state)
{
canvas = glist;
}
if(glist_istoplevel(glist))
if (glist_isvisible(glist) &&
(glist_istoplevel(glist) ||
gobj_shouldvis(x, glist)))
{
if (state)
gui_vmess("gui_gobj_select", "xs",
......
......@@ -606,14 +606,16 @@ void scalar_select(t_gobj *z, t_glist *owner, int state)
if (state)
{
x->sc_selected = owner;
gui_vmess("gui_gobj_select", "xs",
glist_getcanvas(owner), tagbuf);
if (glist_isvisible(owner))
gui_vmess("gui_gobj_select", "xs",
glist_getcanvas(owner), tagbuf);
}
else
{
x->sc_selected = 0;
gui_vmess("gui_gobj_deselect", "xs",
glist_getcanvas(owner), tagbuf);
if (glist_isvisible(owner))
gui_vmess("gui_gobj_deselect", "xs",
glist_getcanvas(owner), tagbuf);
}
//sys_vgui("pdtk_select_all_gop_widgets .x%lx %lx %d\n",
// glist_getcanvas(owner), owner, state);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment