Skip to content
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

Screensaver: add option to require a gesture after resume #9316

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

poire-z
Copy link
Contributor

@poire-z poire-z commented Jul 10, 2022

Rather some kind of "child lock" than real secure protection, which we can't ensure anyway.
See #5970 (comment) and follow ups.
Related feature requests: #5970 #9270 #2255.

Tested on the emulator and my Kobo.
Somehow, by luck because I didn't need to look at all that, this works/happens

  • on resume, frontlight becomes on when the "Waiting for gesture..." message is shown
  • if we hit again the power button, the device goes naturally into suspend (even if I eat all events, this ones goes thru as it might be handled at a lower level :)
  • if gesture forgotten, I can press 2 seconds and release on the power button and the KOReader powers off the device. We can just power on and get back to KOReader.
  • not tested if autosuspend works if we stay some time on the "Waiting for gesture..." message without inputing anything.

Rewording suggestions for the 4 strings welcome: exit/leave screensaver ? specific/owner/user gesture ? Waiting/Something else... ? I don't feel "Input/draw gesture" is to be used, as the gesture can be long-press in corner which wouldn't really be drawing.


This change is Reviewable

@Frenzie Frenzie added this to the 2022.07 milestone Jul 10, 2022
@poire-z poire-z merged commit b6f951e into koreader:master Jul 11, 2022
@poire-z poire-z deleted the exit_screensaver branch July 11, 2022 11:50
@protist
Copy link

protist commented Aug 15, 2022

How is this meant to work exactly? I toggled this on, but there was no prompt to set the gesture.

@poire-z
Copy link
Contributor Author

poire-z commented Aug 15, 2022

There could be at least a message if/that no gesture is yet configured.
But configuring this gesture is a bit independant and far from this menu :) so you have to go into Gesture manager to select some gesture and associate the action Device>Exit screensaver.
(If no gesture is configured, I think we fallback to tap, so people don't get stuck.)

@protist
Copy link

protist commented Aug 17, 2022

Thanks @poire-z. FWIW I have three new devices with Koreader, and none of them showed a message when I enabled the screensaver gesture.

I had a bit of a hunt but couldn't find anything obvious. I could find the Gesture manager, but nowhere obvious to add the correct gesture. Which menu item am I looking for exactly?

@NiLuJe
Copy link
Member

NiLuJe commented Aug 17, 2022

I don't think anything happens when you set the "Exit screensaver gesture" gesture, but if you enable the Screensaver setting that requires the gesture to exit, you definitely get a popup saying that says "the gesture is unset, tap to exit" (or something to that effect) on top of your screensaver when the gesture is unset.

As for the gesture itself, it's in the Gesture manager, which is in [Gear] > Taps and gestures > Gesture manager; at which point you choose which kind of gesture you want to use for it, and find "Exit screensaver" in the list (which, yeah, is kinda backwards if you're not used to the gesture manager framework ;))..
(I'm guessing this was tested with a multiswipe gesture, but I don't personally have multiswipes enabled, so I can't quite recall how it looks in the menu).

@protist
Copy link

protist commented Aug 18, 2022

Thanks @NiLuJe. I'm not entirely sure we're talking about the same thing, so I'll be totally explicit with which steps I took.

I tried to enable the screensaver gesture with the following:
[Gear] > Screen > Screensaver > Settings > Keep the screensaver on screen after wakeup > Until 'Exit screensaver' gesture

This does not create a popup.

I did found where to set the gesture itself (thank you!). However, I can't get this to work. I checked Turn on multiswipes, then set a gesture (up, down) to Exit screensaver. I suspended the device, then woke it up. The screensaver indeed stayed on, with a message saying to perform the gesture, but the gesture would not unlock the screensaver. I forced a power cycle with the physical power button instead.

I then realised that the file browser seems to have a different set of gestures, so I set the Exit screensaver gesture in there as well. (This time <up, down> was taken, so I tested <down, up> instead.) I firstly tested that multiswipes were working at all, which they were. I then tested the screensaver again, but again could not unlock the screensaver.

@poire-z
Copy link
Contributor Author

poire-z commented Aug 18, 2022

This does not create a popup.

When I wrote There could be at least a message if/that no gesture is yet configured, I meant it would be nice if it did - but it currently does not. So don't worry if you don't see that not implemented popup, no one does :)

And yes, one needs to configure the gesture in both reader and filemanager.

Your procedure looks correct, and it should work.
Try assigning this same gesture to some other action to see if it works. Or use another gesture (I remember I tested with one finger swipe on top, and a multiswipe).

@protist
Copy link

protist commented Aug 18, 2022

When I wrote

Thank @poire-z. I understand now . I see @NiLuJe did a sneaky edit to clarify as well 😂

Try assigning this same gesture to some other action to see if it works.

Yes, the gesture (down, up) works when I assign it to another action. Just not for Exit screensaver.

Or use another gesture (I remember I tested with one finger swipe on top, and a multiswipe).

I tested the following, which worked:

  • Tap corner > Bottom right
  • One-finger swipe > Top edge right

I tested a different multiswipe gesture (up, right), and this also failed.

@poire-z
Copy link
Contributor Author

poire-z commented Aug 18, 2022

I tested a different multiswipe gesture (up, right), and this also failed.

If you were on latest nightly (good!), are using Pocketbooks (3 of them ! a bit less good :), try this morning nightly. Multiswipes were broken between these 2 nightlies, #9444.

@protist
Copy link

protist commented Aug 18, 2022

If you were on latest nightly (good!), are using Pocketbooks (3 of them ! a bit less good :)

Sorry, I'm just running the latest stable on (3) Kobo Claras. Also, multiswipe does seem to work for other actions, just not Exit screensaver.

@poire-z
Copy link
Contributor Author

poire-z commented Aug 18, 2022

Well, I don't know then.
I've just tested it on my GloHD with image and it works.

@NiLuJe
Copy link
Member

NiLuJe commented Aug 18, 2022

It also works for me on a Forma, which should have a similar panel, although I had to ditch my halved swipe gesture intervals, because 450ms was way too short for a four direction swipe ;p.

@protist
Copy link

protist commented Aug 22, 2022

I just tested on my Kobo H2O, and this works fine. This was an old installation originally from six years ago (!). This is just not working on the Kobo Claras, with a recent (~2 month) koreader install. Is there any other information I could provide? I wonder if it might be something to do with the different configs? I can try and compare them perhaps?

@NiLuJe
Copy link
Member

NiLuJe commented Aug 22, 2022

Verbose debug logs of you trying to unlock the screen would help, yeah ;).

(Verbose debug flags are in [Tools] > More tools > Developer tools)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants