From: jfa Date: Tue, 1 Nov 2005 14:06:41 +0000 (+0000) Subject: Fix for bug 10433: File name of saved snap doesn't correspond to real time stamp X-Git-Tag: V3_1_0a3~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=df662a292f0953b814d67305408a39ed42c63b23;p=modules%2Fvisu.git Fix for bug 10433: File name of saved snap doesn't correspond to real time stamp --- diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index 95b90d5b..0c24e562 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -500,8 +500,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->winId()); QString aFile(myDumpPath); QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]); @@ -528,11 +532,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;