Bug 439998 - Timer reset does not take effect if the computer is suspended and resumed.
Summary: Timer reset does not take effect if the computer is suspended and resumed.
Status: RESOLVED FIXED
Alias: None
Product: kronometer
Classification: Applications
Component: general (show other bugs)
Version: 2.2.3
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-18 10:28 UTC by Kishore Gopalakrishnan
Modified: 2022-09-22 21:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.3.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2021-07-18 10:28:36 UTC
SUMMARY
If we reset a timer, suspend the computer, resume the computer, and start the timer again, Kronometer continues from the time elapsed prior to reset, instead of starting from zero as expected.

STEPS TO REPRODUCE
1. Run the stopwatch for some time
2. Pause the timer
3. Reset (the refresh button on top)
4. Suspend and resume the computer
5. Start the timer again (the play button)

OBSERVED RESULT
After step 3, the timer is reset to 0:00:00, but when the timer is started at step 5, it somehow remembers and continues from the time that elapsed before step 2

EXPECTED RESULT
After step 5, the timer should start from 0:00:00, not the time that was elapsed before the earlier reset.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.12.15-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Graphics Processor: AMD Radeon™ Vega 8 Graphics
Laptop model: Thinkpad E495

ADDITIONAL INFORMATION
Comment 1 Elvis Angelaccio 2022-09-22 21:25:45 UTC
Git commit 1bc1a8ade91986df6c10df89f5b598c866dea4c1 by Elvis Angelaccio.
Committed on 22/09/2022 at 21:20.
Pushed by elvisangelaccio into branch 'master'.

Fix stopwatch restart after system sleep

m_accumulator was reset to 0 only inside the start() method if the
stopwatch was inactive. But in MainWindow::slotPrepareForSleep() we do
an unconditional pause() on the stopwatch, so this breaks the stopwatch
restart after the system resumes.

The proper fix is to reset m_accumulator inside the reset() method.
FIXED-IN: 2.3.0

M  +1    -0    src/core/stopwatch.cpp

https://invent.kde.org/utilities/kronometer/commit/1bc1a8ade91986df6c10df89f5b598c866dea4c1