eda/gui: Fixed active window confusion
authorJerome St-Louis <jerome@ecere.com>
Wed, 7 Dec 2016 05:44:02 +0000 (00:44 -0500)
committerJerome St-Louis <jerome@ecere.com>
Wed, 21 Dec 2016 05:51:15 +0000 (00:51 -0500)
- When coming back from a modal dialog, clicking a FieldDataBox would no longer activate it

eda/libeda/src/gui.ec

index 04a9216..c27b472 100644 (file)
@@ -495,8 +495,22 @@ public:
    {
       if(!active)
       {
-         if(modifiedDocument && !DataBox::SaveData())
-            Refresh();
+         if(modifiedDocument)
+         {
+            bool thisActive = this.active;
+            bool parentActive = parent.active;
+            Window parentActiveChild = parent.activeChild;
+
+            if(!DataBox::SaveData())
+               Refresh();
+            else
+            {
+               if(this.active == thisActive && parentActive == parent.active && parentActiveChild == parent.activeChild)
+                  ;
+               else
+                  *goOnWithActivation = false;
+            }
+         }
       }
       return true;
    }