From 497b8895febd80ec79a0f3325ca005ed9c46b4ba Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Thu, 11 Feb 2016 00:00:55 -0500
Subject: [PATCH] send old attrs before new attrs for gatom when clicking "Ok"
 on the dialog. This way the undo point gets set correctly even if the user
 has clicked "apply" beforehand

---
 pd/nw/dialog_gatom.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pd/nw/dialog_gatom.html b/pd/nw/dialog_gatom.html
index ccadc8b2b..cfd178d97 100644
--- a/pd/nw/dialog_gatom.html
+++ b/pd/nw/dialog_gatom.html
@@ -234,6 +234,8 @@ function ok() {
     // Steal focus from any active input to make sure it triggers an
     // onchange event
     document.querySelector("button").focus();
+    // send the old attrs first so we can set an undo point on them
+    send_params(old_attrs, false);
     send_params(new_attrs, true);
     cancel(false);
 }
-- 
GitLab