Salome HOME
Splash screen was implemented. Changes in packages SUIT and Session are integrated.
[modules/gui.git] / src / Qtx / QtxDockWindow.cxx
index e87e07a110bdcfc131655927e9ea2088bb42f016..c88c88a1833a479a58df3333c8bcede35a3cd5df 100644 (file)
@@ -72,10 +72,9 @@ bool QtxDockWindow::Watcher::eventFilter( QObject* o, QEvent* e )
   if ( o != myCont && e->type() == QEvent::CaptionChange )
     updateCaption();
 
-  if ( o != myCont &&
-       ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ||
-         e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ||
-         e->type() == QEvent::ChildRemoved ) )
+  if ( ( o != myCont && ( e->type() == QEvent::Hide || e->type() == QEvent::HideToParent ) ) ||
+       ( o == myCont && ( e->type() == QEvent::ChildRemoved ) ) ||
+       ( e->type() == QEvent::Show || e->type() == QEvent::ShowToParent ) )
     updateVisibility();
 
   return false;
@@ -158,10 +157,10 @@ void QtxDockWindow::Watcher::updateVisibility()
     vis = it.current()->widget() && it.current()->widget()->isVisibleTo( myCont );
 
   QMainWindow* mw = myCont->mainWindow();
-  if ( mw && myEmpty != vis )
+  if ( mw && myEmpty == vis )
   {
-    myEmpty = vis;
-    if ( myEmpty )
+    myEmpty = !vis;
+    if ( !myEmpty )
       mw->setAppropriate( myCont, myState );
     else
     {
@@ -170,7 +169,7 @@ void QtxDockWindow::Watcher::updateVisibility()
     }
   }
 
-  vis = myEmpty && myVisible;
+  vis = !myEmpty && myVisible;
   if ( vis != myCont->isVisibleTo( myCont->parentWidget() ) )
     vis ? showContainer() : hideContainer();
 }