--- \dll\iup\a\src\win\iupwin_button.c	Mon Jun 03 20:25:39 2019
+++ iupwin_button.c	Wed Jun 05 10:58:31 2019
@@ -660,21 +660,17 @@
          so we added a test here also */
       if (iupAttribGetBoolean(ih, "CANFOCUS"))
       {
+        static int inside_action = 0;
         Icallback cb = IupGetCallback(ih, "ACTION");
         if (cb)
         {
           /* to avoid double calls when pressing enter and a dialog is displayed */
-          if (!iupAttribGet(ih, "_IUPBUT_INSIDE_ACTION"))  
+          if (!inside_action)  
           {
-            int ret;
-            iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", "1");
-
-            ret = cb(ih);
-            if (ret == IUP_CLOSE)
+            inside_action = 1;
+            if (cb(ih) == IUP_CLOSE)
               IupExitLoop();
-
-            if (ret!=IUP_IGNORE && iupObjectCheck(ih))
-              iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", NULL);
+            inside_action = 0;
           }
         }
       }
