Salome HOME
getViewManager() correction
[modules/gui.git] / src / SalomeApp / SalomeApp_Application.cxx
index 3fee3dfad17184a3239f197a5d41896a186ab56c..401317f2dce29a6c5469eb03146201ac37559ed7 100644 (file)
@@ -714,15 +714,20 @@ SUIT_ViewManager* SalomeApp_Application::getViewManager( const QString& vmType,
 {
   SUIT_ViewManager* aVM = viewManager( vmType );
   SUIT_ViewManager* anActiveVM = CAM_Application::activeViewManager();
+
   if ( anActiveVM && anActiveVM->getType() == vmType )
     aVM = anActiveVM;
-  else if ( aVM )
+
+  if ( aVM && create )
   {
     if ( !aVM->getActiveView() )
       aVM->createView();
+    else
+      aVM->getActiveView()->setFocus();
   }
   else if ( create )
     aVM = createViewManager( vmType );
+
   return aVM;
 }