]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug 10433: File name of saved snap doesn't correspond to real time stamp
authorjfa <jfa@opencascade.com>
Tue, 1 Nov 2005 14:06:15 +0000 (14:06 +0000)
committerjfa <jfa@opencascade.com>
Tue, 1 Nov 2005 14:06:15 +0000 (14:06 +0000)
src/VISU_I/VISU_TimeAnimation.cxx

index bab5863bbc5ee57ef56d27cef06237215277f629..3867f1ec333c7eb4b7e1a6a9b27f1d0ae24220ab 100644 (file)
@@ -462,8 +462,12 @@ void VISU_TimeAnimation::run() {
     }
     myView->Repaint(false);
 
-    int delay = 100;
     if (isDumping) {
+      // We must unlock mutex for some time before grabbing to allow view updating
+      qApp->unlock();
+      msleep(100);
+      qApp->lock();
+
       QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
       QString aFile(myDumpPath);
       QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
@@ -490,11 +494,11 @@ void VISU_TimeAnimation::run() {
                  myFieldsLst[0].myTiming[myFrame]) / aOneVal;
        }
       }
-      delay = (int)(1000. * k / mySpeed);
+      int delay = (int)(1000. * k / mySpeed);
+      qApp->unlock();
+      msleep(delay);
+      qApp->lock();
     }
-    qApp->unlock();
-    msleep(delay);
-    qApp->lock();
 
     if (!myIsActive) break;