Skip to content

Conversation

@liamcharger
Copy link
Contributor

I often use a stopwatch for things like running, and noticed that the watch won’t sleep when the stopwatch is running.

This PR gives the stopwatch the ability to run while the display is off.

@github-actions
Copy link

github-actions bot commented Mar 31, 2024

Build size and comparison to main:

Section Size Difference
text 379988B -80B
data 944B 0B
bss 22544B 0B

Run in InfiniEmu

@mark9064
Copy link
Member

So keep-awake was added in #432

I'm guessing it was so the device doesn't go to sleep right as you want to stop the timer / record a lap. So for people using the stopwatch to time things exactly / shorter durations, this PR is a regression. But when using the stopwatch for longer durations, keeping the screen on is a waste of energy and is annoying (e.g accidental touchscreen clicks while running from clothes)

Maybe there's a solution that keeps both parties happy?

@liamcharger
Copy link
Contributor Author

liamcharger commented Mar 31, 2024

That's true...

Having a setting for the stopwatch specifically would be a waste of resources--maybe implementing a setting for all the apps to enable or disable sleep could be nice, although I don't know if the benefit would be great enough. I can see it possibly working if the user wanted to stop the watch from sleeping when using the navigation app, or maybe when playing a game?

What do you think?

@mark9064
Copy link
Member

mark9064 commented Apr 3, 2024

Hmmm, I like the idea but I don't think it'll be convenient in practice as you may want different settings for each app, and also you need to remember to change it before you start the stopwatch. I think a keep awake toggle in the watch app itself (maybe hidden as a long press or a new button) is the only thing that would work, but I don't know how it'd be implemented in a way that keeps to the InfiniTime vision

@liamcharger
Copy link
Contributor Author

I don't think it'll be convenient in practice as you may want different settings for each app

I meant something like a list of checkboxes in the settings app for each user app, and selecting one would enable/disable sleep for that specific app.

I don't know how it'd be implemented in a way that keeps to the InfiniTime vision

What part of the vision would it be violating?

@mark9064
Copy link
Member

mark9064 commented Apr 4, 2024

I meant something like a list of checkboxes in the settings app for each user app, and selecting one would enable/disable sleep for that specific app.

Oh right, sorry I misunderstood your checkbox idea. Still the point about toggling before, but it matters less.
It does open the can of worms of settings depending on apps installed (as available apps can be configured). AFAIK the infrastructure for this doesn't exist yet, but it should be doable in this case

What part of the vision would it be violating?

There's no strict violation per se, but there are the "Prefer solid default experience over customization" and "Keep it simple" points. Personally I'm a KDE user so you can probably guess my opinion on these but I get why these are design goals for InfiniTime. It'd probably be best if JF weighed in on your idea though, as he definitely has the best idea of what the vision is all about

@mark9064
Copy link
Member

mark9064 commented Feb 12, 2025

Especially with #2141, I'm leaning towards allowing sleep by default as well. There's just not that many situations where I want a screen on stopwatch compared to one where I want to allow idling. It doesn't help that keeping the screen on means ghost touch inputs are very common

@liamcharger
Copy link
Contributor Author

Agreed! I just updated the branch and fixed merge conflicts, so feel free to review.

@mark9064 mark9064 added enhancement Enhancement to an existing app/feature UI/UX User interface/User experience and removed enhancement Enhancement to an existing app/feature labels Feb 14, 2025
@mark9064
Copy link
Member

Looks like you might also need #include <algorithm> and perhaps some others (I guess SystemTask includes them so previously you were getting them with that)

@liamcharger
Copy link
Contributor Author

Yep, noticed the build failure. I'll get to it as soon as I'm on my laptop.

@liamcharger
Copy link
Contributor Author

liamcharger commented May 19, 2025

Fixed with just algorithm! I believe both tasks and timers are need for the sim.

@liamcharger liamcharger force-pushed the stopwatch-allow-sleeping branch 2 times, most recently from a1ef780 to c6199da Compare May 19, 2025 20:35
@mark9064 mark9064 added this to the 1.17.0 milestone Oct 20, 2025
@mark9064
Copy link
Member

Could you rebase this? Happy to approve after, sorry I missed this PR last time

@liamcharger
Copy link
Contributor Author

Just used the merge button on github.com

Hopefully that's alright :)

Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

IMO keep awake with the stopwatch makes it less usable due to accidental screen touches pausing/resetting it, so it's better without (even though the screen turning off might be annoying sometimes too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI/UX User interface/User experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants