From 9403beefaa0320d4540c763a7bc40df4043cdd3d Mon Sep 17 00:00:00 2001 From: george82 Date: Sun, 6 Feb 2005 11:14:39 +0000 Subject: [PATCH] Fixed bug with wrong positiong of slider when it was draged by mouse. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@148 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- rfbplayer/rfbplayer.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx index 6b187117..134bdeec 100644 --- a/rfbplayer/rfbplayer.cxx +++ b/rfbplayer/rfbplayer.cxx @@ -365,7 +365,6 @@ RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; case TB_ENDTRACK: setPos(Pos); - updatePos(Pos); sliderDraging = false; return 0; default: @@ -719,6 +718,7 @@ void RfbPlayer::processMsg() { rewind(); setPaused(true); updatePos(getTimeOffset()); + SendMessage(posTrackBar, TBM_SETPOS, TRUE, 0); return; } // It's a special exception to perform backward seeking. @@ -765,7 +765,6 @@ void RfbPlayer::serverInit() { SendMessage(posTrackBar, TBM_SETRANGE, TRUE, MAKELONG(0, min(sessionTimeMs / 1000, MAX_POS_TRACKBAR_RANGE))); sliderStepMs = sessionTimeMs / SendMessage(posTrackBar, TBM_GETRANGEMAX, 0, 0); - updatePos(getTimeOffset()); setPaused(!autoplay); @@ -927,7 +926,7 @@ long RfbPlayer::getTimeOffset() { void RfbPlayer::updatePos(long newPos) { // Update time pos in static control char timePos[30] = "\0"; - double sliderPos = newPos; + long sliderPos = newPos; newPos /= 1000; sprintf(timePos, "%.2um:%.2us (%s)", newPos/60, newPos%60, fullSessionTime); SetWindowText(timeStatic, timePos); @@ -935,7 +934,8 @@ void RfbPlayer::updatePos(long newPos) { // Update the position of slider if (!sliderDraging) { sliderPos /= sliderStepMs; - SendMessage(posTrackBar, TBM_SETPOS, TRUE, sliderPos); + if (sliderPos > SendMessage(posTrackBar, TBM_GETPOS, 0, 0)) + SendMessage(posTrackBar, TBM_SETPOS, TRUE, sliderPos); } } -- 2.39.5