From 605da1dff33c1ecab19d2ece82f3a97c892ee964 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Thu, 2 Nov 2017 23:06:53 -0400
Subject: [PATCH] port from vanilla: initialize save-as name of untitled
 patches so that if you just leave the title unchanged you don't get "save as"
 action again on next save

commit: 470032130e2b0135b97151d719c4706d68f3c380

We ignore the reversion and workaround in a later vanilla commit for an
OSX tk issue that doesn't apply to nw.js
---
 pd/src/g_readwrite.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c
index ca888857e..26654e296 100644
--- a/pd/src/g_readwrite.c
+++ b/pd/src/g_readwrite.c
@@ -885,7 +885,12 @@ static void canvas_savetofile(t_canvas *x, t_symbol *filename, t_symbol *dir,
 static void canvas_menusaveas(t_canvas *x, t_floatarg fdestroy)
 {
     t_canvas *x2 = canvas_getrootfor(x);
-    gui_vmess("gui_canvas_saveas", "xssi", x2, x2->gl_name->s_name, canvas_getdir(x2)->s_name, fdestroy != 0);
+    gui_vmess("gui_canvas_saveas", "xssi",
+        x2,
+        (strncmp(x2->gl_name->s_name, "Untitled", 8) ?
+            x2->gl_name->s_name : "title"),
+        canvas_getdir(x2)->s_name,
+        fdestroy != 0);
 }
 
 static void canvas_menusave(t_canvas *x, t_floatarg fdestroy)
-- 
GitLab