-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow transitioning from *sleep* to *power off* #2431
Comments
Not sure this issue is about screensaver. |
@poire-z But can it be handled by KOReader? |
On Kobo, it is handled by KOreader: koreader/frontend/ui/uimanager.lua Lines 87 to 107 in 0d66ea7
koreader/frontend/ui/uimanager.lua Lines 55 to 65 in 0d66ea7
So, solving this issue would need some trickery around these (but I won't try it :) |
Ok :) I don't have Kobo so I can't help. |
This allows to shutdown straight from suspend just like Nickel. Fixes <koreader#2431>.
This allows to shutdown straight from suspend just like Nickel. Fixes <#2431>.
@avsej Could you be a bit more specific? This is Kobo-specific code. |
This reverts commit cfa73be. Cervantes and Sony secretly depend on hacky Kobo code. Reported by @avsej, see <koreader#2431 (comment)>. Closes <koreader#5292>.
@Frenzie : From a very quick glance, I think the Cervantes/Sony blocks in uimanager rely on the "Resume" event, which went poof with this ;). |
Indeed. We've got a case of confusing design or just a quick hack from years ago spreading out like an oil spill here. :-P |
Indeed. I might be still confused now as I don't understand why this code path should be reachable only for kobos. |
The split in Press/Release is fine and generic enough in theory, but deciding that "Resume" is the correct action to take based on that input event is UIManager logic infiltrating in the Input module. Back a few years ago this lack of separation was "Kobo only" and I just hadn't quite caught up to that fact. ;-) |
My Cervantes 4, unable to resume after suspend with this patch. I had to reboot it. But even after reboot it does not wake up after suspend. While the change is kobo-specific, the fix goes into common code path, and affect other devices. |
The change isn't Kobo-specific exactly. The common code path should definitely look the other way architecturally speaking. ;-) Anyway, thanks for reporting! |
Uh-oh. I think that I understand now: instead of returning "Resume" from input.lua return "PowerPress | PowerRelease" and let UiManager handle that? |
See <koreader#2431 (comment)>. Supersedes <koreader#5302>.
Right, The original hack from b86aa5a made a lot more sense than the spaghetti monster we ended up with in subsequent rewrites: if ev.value == EVENT_VALUE_KEY_RELEASE then
if keycode == "Light" then
return keycode
elseif keycode == "Power" then
-- Kobo generates Power keycode only, we need to decide whether it's
-- power-on or power-off ourselves.
if self.device.screen_saver_mode then
return "Resume"
else
return "Suspend"
end
end
end It's still breaking the abstraction in a way I'd prefer to avoid in |
See <#2431 (comment)>. Supersedes <#5302>.
This allows to shutdown straight from suspend just like Nickel. Fixes <koreader#2431>.
Some users might put the device to sleep by mistake and then try to power it off directly.
This will currently fail.
The text was updated successfully, but these errors were encountered: