Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into CEA_2019
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index 2d6e806705cf5f35ceb4808ecab2c8dfc2fa6528..a96e15ff07179c97dffa4719e96d4fd52423d30e 100644 (file)
@@ -154,6 +154,7 @@ void activateWindow(QWidget* theWidget, const QString& theInfo)
 
 void setFocus(QWidget* theWidget, const QString& theInfo)
 {
+  activateWindow(theWidget);
   theWidget->setFocus();
   // rectangle of focus is not visible on tool button widgets
   theWidget->update();
@@ -407,13 +408,15 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe
     hasParameter |= (aConstruction.get() != NULL);
     if (hasFeature)
       hasCompositeOwner |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL);
+    else if (aResult.get())
+      hasCompositeOwner |= (ModelAPI_Tools::bodyOwner(aResult) != NULL);
 
     if (!hasResultInHistory && aResult.get()) {
       FeaturePtr aFeature = ModelAPI_Feature::feature(aResult);
       hasResultInHistory = aFeature.get() && aFeature->isInHistory();
     }
 
-    if (hasFeature && hasResult  && hasParameter && hasCompositeOwner && hasFeature)
+    if (hasFeature && hasResult  && hasParameter && hasCompositeOwner)
       break;
   }
 }
@@ -760,6 +763,7 @@ void flushUpdated(ObjectPtr theObject)
   // (for the sketch result) to start processing of the sketch in the solver.
   // TODO: these flushes should be moved in a separate method provided by Model
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+  Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_VISUAL_ATTRIBUTES));
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));