From da7b9b5cb0753f4a1b4f88405b8ad750d1dd435a Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Wed, 17 Jun 2020 16:53:48 -0400
Subject: [PATCH] Disabled pasting inside a toplevel garray since that should
 be just for plots and nothing else

Added comment to provide an update on an issue documented in the comments
---
 pd/src/g_editor.c | 3 +++
 pd/src/g_scalar.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index cc98c265e..b8f348b3f 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -6487,6 +6487,9 @@ static void canvas_paste(t_canvas *x)
 {
     if (!x->gl_editor)
         return;
+    // ico@vt.edu: prevent pasting in a toplevel garray window
+    if (x->gl_list && glist_istoplevel(x) && canvas_hasarray(x))
+        return;
     if (x->gl_editor->e_textedfor)
     {
             /* simulate keystrokes as if the copy buffer were typed in. */
diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c
index 984accf40..e9f9de494 100644
--- a/pd/src/g_scalar.c
+++ b/pd/src/g_scalar.c
@@ -1264,6 +1264,7 @@ int scalar_doclick(t_word *data, t_template *template, t_scalar *sc,
 /* Unfortunately, nested gops don't yet handle scalar clicks correctly. The
    nested scalar seems not to receive the click.  However, the enter/leave
    messages happen just fine since most of their logic is in tcl/tk. */
+/* ico@vt.edu: I tried nested GOP and it appears to work ok */
 static int scalar_click(t_gobj *z, struct _glist *owner,
     int xpix, int ypix, int shift, int alt, int dbl, int doit)
 {
-- 
GitLab