-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Introduce a restricted clock-only-mode when not woken with the button #1359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Why is this necessary? Wouldn't this feature be useful regardless of the active app? |
The reasoning is that if you (for example) are playing the "2" game and the screen goes to sleep due to no activity, if you then wake up the screen by shaking your arm, touch input will be ignored and if you push the hardware button you will exit the game, loosing the progress. |
I think this is exactly how this should be done. The watch goes into a lock mode where the first button press does nothing but exiting that mode. Maybe we could have a popup with a lock symbol and something like "press the button to unlock" on touch events so users can better understand what is going on. Another thing is a lock screen. We could always show the watch face on non-button wakeup (with a clue that this is a lock screen) and after pressing the button go back to the current screen. This is closer to what other devices like phones do. |
I agree with @minacode although I don't think a real "lock screen" makes sense. Maybe a visual indicator but a lock screen for a watch that only has a couple of modes is a bit much. One reason I prefer it is because it enables you to have for example the navigation or timer app open on the watch and look at it from time to time. Right now this would always randomly switch to different watch faces on it's own. |
And because I know it will be mentioned: |
Thanks for the into @minacode and @Joheyy! I'll look into the possibility of implementing a "pop up" notifying about the lock and that the hardware button should be used to unlock. |
Keep in mind that the watch can wake itself (for example via notifications). |
I've just pushed a new commit that adds a 'Popup' notification and display it when a touch input is received during 'locked' wakeup. The lock is now active on all screens, though not when an app as caused the wakeup. |
That approach seems good, also very similar to that of say Apple Watch. |
I like it. Can you explain the intuition behind the three WokenBy values? Button explains itself, but what exactly are WakeUpAction and Other? What cases do and don't they cover? |
The WokenBy values are:
In reality it might be possible to replace the values with a simple boolean |
I would like that in a comment, in the code. Or better names, I don't know. UserButtonWakeup, UserNonButtonWakeup, SystemAutoWakeup? Sounds weird as well.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a good idea to move the popup to displayapp and use displayapp/Messages.h
to communicate between the systemtask and DisplayApp
Changed as suggested |
Build size and comparison to main:
|
Any updates on this? |
I've introduced a second page to the WakeUp settings since there was no room left for new checkbox. @NeroBurner Are you up for a re-review? |
The popup seems rather intrusive. If we are trying to avoid activity that occurs fairly frequently then it is possible that the popup will obscure the display when the user wants to view the watchface. Could we just use a lock icon instead? This is a user configured feature that would probably be disabled by default so the user must enable it and therefore shoudl understand the purpose of the icon. (It could be reinforced by showing the same icon in the settings screen.) The lock icon could show in a notification space, e.g. top of screen. It could either be always visible when locked, shown on activity or visible and highlight on activity. This may also reduce the memory increase. (One icon may be less than lots of text?) I really like the idea of a lock mechanism (as I too suffer the issue of unexpected activity) but don't want something obscuring the screen. |
I'm in favor of the lock as it doesn't need to be translated and should be easily understood. I like the visual hint to use the lock in the setting screen as well |
I also would love to see this feature added. I don't know how, but I constantly am waking the screen and accidentally tapping on screen elements. This would solve this issue for me! |
Please note that the lock screen first shows up after the screen has been woken up AND a touch gesture has been identified, meaning that the lock screen does not automatically show when the display is on.
This is a valid point, I'll change the lock screen to use an actual icon. Regarding using the lock in the in the settings, how do you envision this to be done? See the screenshot below for the current settings screen, shown is the (new) second settings page under "Wake Up". Where should the lock icon be placed?
If I understand you correctly, this would be nice, but it would require that InfiniTime has a global notification bar for it to be consisted across screens, which it don't, so I think I'll stick with the pop-up for now. |
@NeroBurner @riban-bw |
Could it also have an arrow pointing to the crown button to indicate how to
unlock?
…On Sat, Jan 27, 2024, 16:11 tgc-dk ***@***.***> wrote:
@NeroBurner <https://github.com/NeroBurner> @riban-bw
<https://github.com/riban-bw>
Using the popup with a lock icon could look like this:
InfiniSim_2024-01-27_220733.png (view on web)
<https://github.com/InfiniTimeOrg/InfiniTime/assets/1773050/ba6d0933-867f-452a-856f-93a528b4347e>
—
Reply to this email directly, view it on GitHub
<#1359 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAICFIIU5BA6YKZT2O2UPUDYQVUPHAVCNFSM6AAAAAAQ53RW2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGMZTMOJSGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Now having 7 days of uptime. Seems stable 🎉 |
I've been using this branch in my own build for over a year now. It's been really nice to prevent accidental touches. Here's a detailed method that seems to be 100% reproducible for me.
I've also gotten a crash by waking the screen with a timer or alarm, and then double-pressing the button to get to the notifications. It seems less consistent, and I've never accidentally triggered a crash this way, but I noticed the possibility of the same problem as I was trying to find a solution to this crash, and tested it out as well.
I haven't been able to reproduce either these methods consistently in InfiniSim. For my own build, I worked around the problem by setting unlockedByButton = true in SystemTask.cpp when getting a new notification, or when double-pressing the button. It prevents the crash, but at least in the case of receiving a notification unlocks the screen without user interaction and can lead (and for me has led) to accidental presses, so it's not an ideal fix. I haven't been able to track down the root cause. I think it's got to be something to do with the active app changing whilst locked, but I haven't been able to get any further than that. |
can reproduce (the second guide with double-press). Thanks a lot for finding it and the thorough steps to reproduce the issue |
I've been using this branch for about a week and it's made my PineTime much more usable for me. The accidental touches were constantly causing my watch to end up on non-clock screens. Thank you!! |
Thank you for the PR! When I touch the screen while it is locked, I see the popup until the screen is off. I think it would be better to show the lock for ~ half a second: it is enough to know that the screen is locked and allow to see the watch face after that Less important, but it may be a good idea to show the popup for long press and swipe only on the watch face BTW, it is possible to make the lock more transparent, it is very white with the casio face ? |
There is a double free, I'm opening a PR on your repo EDIT: tgc-dk#6 this can be fixed by calling |
When the device is woken through pressing the button everything is the same. But when woken through other means like single-tap or raise-to-wake, then the screen is locked (and showing a lock screen on touch input) until the button is pressed. Only exception is when the alarm wakes the screen, then touch input is still valid for the user to be able to press the red "stop alarm" button. Co-authored-by: NeroBurner <pyro4hell@gmail.com>
It fixes a potential double-free when removing lock popup
Can confirm the second crash reproduction is now fixed. Thanks @p1gp1g |
131f294
to
10344e5
Compare
I agree, but I'd like this PR to be kept simple. I essentially hijacked it and would like it to be merged as soon as possible. So I try to keep the PR itself to be simple and easily reviewable. So I propose a new PR after this one is merged
Good idea. I'd need to see if this a simple change or if it makes the code more complicated
I'm no designer, so I'd like to delegate this to someone else (i.e. please open a a new PR after this one is merged) |
I've found another bug (tested before my patch too), I'll dig it later to get a patch, but I think I know what to do:
It will crash I think it can be fixed by calling |
can reproduce 😅 thanks a lot! |
Fixes #1839 |
Ping me when this is ready for review :) |
I've been testing this for a couple of weeks. My main issue is that the lock icon is shown as an overlay covering the time, so I can't read the time when it's visible. I'd prefer the lock to be shown on top of the time (e.g.: near the batter/bluetooth icons maybe), so I can still read the time while it's displayed. |
@WhyNotHugo That's basically how Bangle JS handles this mechanic and it works really well, IMO. |
I just wanted to implement you fix, but that is effectively already done. InfiniTime/src/systemtask/SystemTask.cpp Line 440 in 3282333
Do you maybe have other ideas, or did I misunderstand your fix? |
found another workaround. Double press button also unlocks the watch |
I just had a crash I think related to this PR, only changes are this plus font bpp changes the the bpp stuff has been stable for quite a while. Notification arrived, I tried to swipe and got the lock icon, so I pressed the button to unlock, tried to swipe but the screen was unresponsive, then the watch rebooted. I just made it happen again, I pressed the button just after/at the same time as the notification disappeared, perhaps related? |
thanks for trying it out and finding a bug. I think I'll have to call hide overlay before changing the screen to be sure it is always properly unloaded from each frame. otherwise lvgl will delete it as part of the screens decunstructor |
we already do that... so why does it segfault/reboot 🤔 InfiniTime/src/displayapp/DisplayApp.cpp Line 513 in 10344e5
|
It may be because Try: void SystemTask::GoToSleep() {
if (IsSleeping()) {
return;
}
if (IsSleepDisabled()) {
return;
}
NRF_LOG_INFO("[systemtask] Going to sleep");
+ displayApp.PushMessage(Pinetime::Applications::Display::Messages::HideIgnoreTouchPopup);
if (settingsController.GetAlwaysOnDisplay()) {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToAOD);
} else {
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToSleep);
}
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
unlockedByButton = false;
- displayApp.PushMessage(Pinetime::Applications::Display::Messages::HideIgnoreTouchPopup);
state = SystemTaskState::GoingToSleep;
}; |
I think it would be better if this feature wasn’t enabled by default and could be turned off in the settings. I personally don’t run into the problem this PR fixes, so I likely wouldn’t use the feature and would appreciate the option to disable it. Maybe the setting for this could be placed under an "Accessibility" page in the settings menu? This would be descriptive enough to be intuitive and allow future features to be included as well, unlike a "Unlock Watch" setting. |
To avoid random touches ends up changing settings or starting a timer, this introduces a restricted mode where no touch input is accepted unless the hardware button is used to turn on the watch.
A settings is introduces to enable this.The restricted mode is only active on watchfaces.This is not a perfect solution since it will require the button to be pressed several times to leave the restricted mode once in it.
edit 2025-05-24: updated description by @NeroBurner :
When the device is woken through pressing the button everything is the same.
But when woken through other means like single-tap or raise-to-wake,
then the screen is locked (and showing a lock screen on touch input)
until the button is pressed.
Only exception is when the alarm wakes the screen, then touch input is
still valid for the user to be able to press the red "stop alarm"
button.