Salome HOME
Issue #2365 problem with active panel in feature and Hide faces windows
[modules/shaper.git] / src / XGUI / XGUI_PropertyPanel.cpp
index b878d62c5ae7011c164762686b26ac0717955c49..737027b35aafce7b6bdc1a9fab0d220722499f34 100755 (executable)
@@ -490,12 +490,11 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
 #ifdef DEBUG_ACTIVE_WIDGET
   std::cout << "myActiveWidget = " << (theWidget ? theWidget->context().c_str() : "") << std::endl;
 #endif
-  static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
-  Events_Loop::loop()->flush(anEvent);
-
+  bool anIsNoMoreWidgets = false;
   if (isEmitSignal) {
     //emit widgetActivated(myActiveWidget);
     if (!myActiveWidget && !isEditingMode()) {
+      anIsNoMoreWidgets = true;
       emit noMoreWidgets(aPreviosAttributeID);
     }
   }
@@ -505,6 +504,13 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
     emit propertyPanelDeactivated();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
+
+  if (!anIsNoMoreWidgets && myActiveWidget)
+  {
+    // restore widget selection should be done after selection modes of widget activating
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
+    Events_Loop::loop()->flush(anEvent);
+  }
   return true;
 }