mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Unbreak native screensavers on Kindle >= 5.7.2
Which I broke the last time I touched this. NOTE: I'm not quire sure why the bbsave/bbrestore on stop/resume did a double check (screensaver & charging), because that effectiely disabled it when charging, which I don't quite understand... Also makes sure the needsScreenRefreshAfterResume flag is honored on Kindles, because we need it on FW >= 5.7.2 Note that this *breaks* the behavior with passcode enabled, which was unwittingly fixed in said previous changes... re #1811
This commit is contained in:
@@ -78,21 +78,32 @@ end
|
||||
-- ONLY used for Kindle devices
|
||||
function Device:intoScreenSaver()
|
||||
local UIManager = require("ui/uimanager")
|
||||
if self.charging_mode == false and self.screen_saver_mode == false then
|
||||
if self.screen_saver_mode == false then
|
||||
self.screen:saveCurrentBB()
|
||||
self.screen_saver_mode = true
|
||||
end
|
||||
UIManager:sendEvent(Event:new("FlushSettings"))
|
||||
-- On FW >= 5.7.2, we sigstop awesome, but we need it to show stuff...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -cont awesome")
|
||||
end
|
||||
end
|
||||
|
||||
-- ONLY used for Kindle devices
|
||||
function Device:outofScreenSaver()
|
||||
if self.screen_saver_mode == true and self.charging_mode == false then
|
||||
-- On FW >= 5.7.2, put awesome to sleep again...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -stop awesome")
|
||||
end
|
||||
if self.screen_saver_mode == true then
|
||||
-- wait for native system update screen before we recover saved
|
||||
-- Blitbuffer.
|
||||
util.usleep(1500000)
|
||||
self.screen:restoreFromSavedBB()
|
||||
self:resume()
|
||||
if self:needsScreenRefreshAfterResume() then
|
||||
self.screen:refreshFull()
|
||||
end
|
||||
end
|
||||
self.screen_saver_mode = false
|
||||
end
|
||||
|
||||
@@ -41,7 +41,7 @@ if [ "${INIT_TYPE}" == "upstart" ] ; then
|
||||
fi
|
||||
|
||||
# Keep track of what we do with pillow...
|
||||
AWESOME_STOPPED="no"
|
||||
export AWESOME_STOPPED="no"
|
||||
PILLOW_HARD_DISABLED="no"
|
||||
PILLOW_SOFT_DISABLED="no"
|
||||
|
||||
@@ -297,9 +297,9 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
||||
# NOTE: Try to leave the user with a slightly more useful FB content than our own last screen...
|
||||
cat /var/tmp/koreader-fb.dump > /dev/fb0
|
||||
rm -f /var/tmp/koreader-fb.dump
|
||||
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home
|
||||
# NOTE: In case we ever need an extra full flash refresh...
|
||||
#eips -s w=${SCREEN_X_RES},h=${SCREEN_Y_RES} -f
|
||||
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home
|
||||
fi
|
||||
if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then
|
||||
logmsg "Restoring the status bar . . ."
|
||||
|
||||
Reference in New Issue
Block a user