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

ScreenSaverLock: Hide the popup on suspend ^2 #11174

Merged
merged 3 commits into from Nov 28, 2023

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Nov 27, 2023

Because GH ate a commit during a rebase for some reason (it's fine locally, whatever).

Replaces #11170


This change is Reviewable

If we get the events, it means stuff happened, we can't just only honor
it in the most common workflows ;).

This effectively reverts a tiny bit of koreader#10426 (I was sort of expecting
this to be problematic at the time, and I most likely hadn't tested it).
@Frenzie Frenzie added this to the 2023.12 milestone Nov 27, 2023
@mergen3107
Copy link
Contributor

I reverted patch 11170, then applied this patch 11174.

Works great!
Here is the verbose log.
crash_11174_ss2.log.txt

When unlock - message shows up and frointlight turens on. When I lock it back - message goes away, whole screen refreshes, frontlight goes off.

The same with the sleep cover.
One intersting thing I found (tried a few time in the very end of the log) is that if semi-close the cover - the message goes away, screen flashes, but frontlight and KOReader stay up. Don't know if this is intended or not.

@NiLuJe
Copy link
Member Author

NiLuJe commented Nov 27, 2023

Don't know if this is intended or not.

I have absolutely no idea what the native system does with sleep covers; but as far as we're concerned, the IntoSS and OutOfSS Events are all properly in step lock, so it all looks good.

@mergen3107
Copy link
Contributor

The same behaviour can be achieved if:

  • press power button - see message
  • rotate the screen upside down - screen rotates, message goes agay, frontlight stays on

@NiLuJe
Copy link
Member Author

NiLuJe commented Nov 28, 2023

I don't have a sleep cover to test with, but my trusty fridge magnet seems to behave as well as can be expected.

I have seen it take a few seconds to "register" a "close" sometimes (and also a few cases of close -> open jitter, but, again, I'm placing a magnet by hand so this is pretty inaccurate to begin with ;p).

@NiLuJe
Copy link
Member Author

NiLuJe commented Nov 28, 2023

Fun fact: the lipc events pass a different argument depending on the source of the wakeup (c.f., lipc-wait-event -m -s 0 -t com.lab126.powerd '*').

Button:

goingToScreenSaver 2
outOfScreenSaver 1

Hall sensor:

goingToScreenSaver 4
outOfScreenSaver 6

Not that this would help us much, as we don't really control the whole thing unlike on Kobo, but, still, fun tidbit nonetheless. (I'm also not confident those arguments would be quite portable, this is on a PW2).

@NiLuJe
Copy link
Member Author

NiLuJe commented Nov 28, 2023

TL;DR: So, yeah, this looks as ready as it'll ever be.

@NiLuJe
Copy link
Member Author

NiLuJe commented Nov 28, 2023

  • rotate the screen upside down - screen rotates, message goes agay, frontlight stays on

That one makes perfect sense, actually.

That message is a hack, it's a one-time paint job, not a real widget. Anything that requires a redraw will effectively dismiss it. And, of course, rotation requires a redraw ;).

On the upside, if the device were actually asleep, you shouldn't be able to rotate it (assuming the gyro isn't a wakeup source and/or it's handled properly if it is).

Copy link
Member Author

@NiLuJe NiLuJe left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)

@mergen3107
Copy link
Contributor

Looks and works great! Thank you NiLuJe!

@NiLuJe NiLuJe merged commit 4a64e02 into koreader:master Nov 28, 2023
4 checks passed
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

3 participants