From 62edc81a3400a8d1c0dd7b25cd96367c09b3376e Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Sun, 3 Jan 2016 17:30:39 -0500
Subject: [PATCH] fix regression with dialog windows refusing to close

---
 pd/nw/dialog_canvas.html | 2 +-
 pd/nw/dialog_font.html   | 2 +-
 pd/nw/dialog_gatom.html  | 2 +-
 pd/nw/dialog_iemgui.html | 2 +-
 pd/nw/dialog_prefs.html  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pd/nw/dialog_canvas.html b/pd/nw/dialog_canvas.html
index 5d93dc377..65227f595 100644
--- a/pd/nw/dialog_canvas.html
+++ b/pd/nw/dialog_canvas.html
@@ -754,7 +754,7 @@ function add_events(name) {
         //pdgui.pdsend(name + " menuclose 0");
         //cancel();
         pdgui.remove_dialogwin(pd_object_callback);
-        this.close(true);
+        gui.Window.get().close(true);
     });
     pdgui.dialog_bindings(name);
 }
diff --git a/pd/nw/dialog_font.html b/pd/nw/dialog_font.html
index a1568f224..390c125b8 100644
--- a/pd/nw/dialog_font.html
+++ b/pd/nw/dialog_font.html
@@ -186,7 +186,7 @@ function add_events(name) {
         //pdgui.pdsend(name, "menuclose 0");
         //cancel();
         pdgui.remove_dialogwin(pd_object_callback);
-        this.close(true);
+        gui.Window.get().close(true);
     });
     pdgui.dialog_bindings(name);
 }
diff --git a/pd/nw/dialog_gatom.html b/pd/nw/dialog_gatom.html
index 1600e3c0d..ab5d895ed 100644
--- a/pd/nw/dialog_gatom.html
+++ b/pd/nw/dialog_gatom.html
@@ -275,7 +275,7 @@ function add_events(name) {
         //pdgui.pdsend(name, "menuclose 0");
         //cancel();
         pdgui.remove_dialogwin(pd_object_callback);
-        this.close(true);
+        gui.Window.get().close(true);
     });
     pdgui.dialog_bindings(name);
 }
diff --git a/pd/nw/dialog_iemgui.html b/pd/nw/dialog_iemgui.html
index 4a7d31add..7f6ab7497 100644
--- a/pd/nw/dialog_iemgui.html
+++ b/pd/nw/dialog_iemgui.html
@@ -559,7 +559,7 @@ function add_events(name) {
         //pdgui.pdsend(name, "menuclose 0");
         //cancel();
         pdgui.remove_dialogwin(pd_object_callback);
-        this.close(true);
+        gui.Window.get().close(true);
     });
     pdgui.dialog_bindings(name);
 }
diff --git a/pd/nw/dialog_prefs.html b/pd/nw/dialog_prefs.html
index ebcbdb1f2..ba491c778 100644
--- a/pd/nw/dialog_prefs.html
+++ b/pd/nw/dialog_prefs.html
@@ -634,7 +634,7 @@ function add_events(name) {
     gui.Window.get().on("close", function() {
         // this needs to do whatever the "cancel" button does
         pdgui.remove_dialogwin(pd_object_callback);
-        this.close(true);
+        gui.Window.get().close(true);
     });
     pdgui.dialog_bindings(name);
 }
-- 
GitLab