From 7db762c9f5bf59bb6a5e871032512da79ce6a56d Mon Sep 17 00:00:00 2001
From: Miller Puckette <msp@ucsd.edu>
Date: Wed, 12 Dec 2007 20:11:46 -0800
Subject: [PATCH] bug fix, open GOP on close

---
 src/g_canvas.c |  5 +++--
 src/notes.txt  | 14 +++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/g_canvas.c b/src/g_canvas.c
index 10f897c17..872c2653c 100644
--- a/src/g_canvas.c
+++ b/src/g_canvas.c
@@ -738,7 +738,7 @@ void canvas_create_editor(t_glist *x, int createit)
     }
     for (y = x->gl_list; y; y = y->g_next)
         if (pd_class(&y->g_pd) == canvas_class &&
-            ((t_canvas *)y)->gl_isgraph)
+            ((t_canvas *)y)->gl_isgraph && !((t_canvas *)y)->gl_havewindow)
                 canvas_create_editor((t_canvas *)y, createit);
 }
 
@@ -808,7 +808,8 @@ void canvas_vis(t_canvas *x, t_floatarg f)
         if (glist_isgraph(x) && x->gl_owner)
         {
             t_glist *gl2 = x->gl_owner;
-            canvas_create_editor(x, 1);
+            if (!x->gl_owner->gl_isdeleting)
+                canvas_create_editor(x, 1);
             if (glist_isvisible(gl2))
                 gobj_vis(&x->gl_gobj, gl2, 0);
             x->gl_havewindow = 0;
diff --git a/src/notes.txt b/src/notes.txt
index 945eb7a26..3da075642 100644
--- a/src/notes.txt
+++ b/src/notes.txt
@@ -1,7 +1,6 @@
 ---------------- dolist --------------------
-  binbuf_read_via_canvas in x_qlist.c
-
-PC device counting problem (first device invoked by -audiodev 0)
+fixed crash bug closing patches with open GOPs
+fixed PC device counting problem (first device invoked by -audiodev 0)
 
 test:
 compile on various versions of linux
@@ -12,8 +11,8 @@ windows:
   "-audiodev" with no args in registry can't start up?
 mac:
   clicking on windows seems sometimes not to open them
-what does OSX do when jack is compiled into Pd but not installed??
-turn on paMacCore_ChangeDeviceParameters for mac (pa_mac_core.h)
+  what does OSX do when jack is compiled into Pd but not installed??
+  turn on paMacCore_ChangeDeviceParameters for mac (pa_mac_core.h)
 Gnome: why don't windows pop up when clicked on?
 
 problems:
@@ -23,7 +22,6 @@ objects on GOP don't erase if you edit the GOP while they're showing
 MSTACKSIZE limitation in m_binbuf.c
 add -stack option to make 'regular' stack larger
 TK menu on Windows says "wish"
-activating windows in Gnome?
 help browser broke on Panurge
 offer both new and old help browser style
 look again at array vis/invis conundrum, g_template.c
@@ -56,7 +54,9 @@ real-time spectrum grapher
 document ||, |, etc, better
 
 features:
-clickles connection (hit 'c' key or something)
+clicking to prefer selected object if nselect > 1
+flag to prevent unlocking patches
+clickless connection (hit 'c' key? see Bouchard paper)
 messages to suppress menus&accelerators, and invisibilize Pd window
 machine-independent fonts
 callback scheduling on Mac
-- 
GitLab