From 879b59345511b7bcea8b5118cf97f865c042961d Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 12 Apr 2016 16:01:16 +0200 Subject: [PATCH 1/4] Refresh the UI properly on exit on more Kindle FW This broadens the fix applied to FW >= 5.6.5 to the whole range of FW 5.x, because it appears to be needed on some FW 5.3.7.x versions... Fix #1924 --- platform/kindle/koreader.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 6f0290fec..518a471c2 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -197,11 +197,11 @@ fi if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then count=$(lipc-get-prop -eiq com.github.koreader.kpvbooklet.timer count) if [ "$count" == "" -o "$count" == "0" ] ; then + # NOTE: Dump the fb so we can restore something useful on exit... + cat /dev/fb0 > /var/tmp/koreader-fb.dump # NOTE: We want to disable the status bar (at the very least). Unfortunately, the soft hide/unhide method doesn't work properly anymore since FW 5.6.5... if [ "$(printf "%.3s" $(grep '^Kindle 5' /etc/prettyversion.txt 2>&1 | sed -n -r 's/^(Kindle)([[:blank:]]*)([[:digit:].]*)(.*?)$/\3/p' | tr -d '.'))" -ge "565" ] ; then PILLOW_HARD_DISABLED="yes" - # NOTE: Dump the fb so we can restore something useful on exit... - cat /dev/fb0 > /var/tmp/koreader-fb.dump # FIXME: So we resort to killing pillow completely on FW >= 5.6.5... logmsg "Disabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow disable @@ -313,6 +313,10 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then logmsg "Restoring the status bar . . ." lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}' + # 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 fi fi From a3536e28a6363bd522512a733fb6019f87279c1a Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 12 Apr 2016 16:06:43 +0200 Subject: [PATCH 2/4] Bypass a few unneeded usleep when possible If awesome is stopped, it won't cause any trouble ;). --- platform/kindle/koreader.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 518a471c2..fdd4d074b 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -217,7 +217,8 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.hideMe();"}' PILLOW_SOFT_DISABLED="yes" fi - if [ "${NO_SLEEP}" == "no" ] ; then + # NOTE: We don't need to sleep at all if we've already SIGSTOPped awesome ;) + if [ "${NO_SLEEP}" == "no" -a "${AWESOME_STOPPED}" == "no" ] ; then # NOTE: Leave the framework time to refresh the screen, so we don't start before it has finished redrawing after collapsing the title bar usleep 250000 # NOTE: If we were started from KUAL, we risk getting a list item to popup right over us, so, wait some more... From 0a32390f21525bf52e82470de381942039b78c19 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 12 Apr 2016 16:14:44 +0200 Subject: [PATCH 3/4] Bump base --- base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base b/base index d040d1dab..a4b00ac59 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit d040d1dab1a2e70ba321b43c569485e5ec1a8ffb +Subproject commit a4b00ac59018d1910972dd4bac8ece3ec1ba8553 From 66b40955c6d611cbd4f7261b2a58f6c6a53c36be Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Tue, 12 Apr 2016 17:09:21 +0200 Subject: [PATCH 4/4] Tweak the timing of the previous commit a bit On those FW, we can get an up-to-date status bar, instead of the one from our fb dump ;). --- platform/kindle/koreader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index fdd4d074b..339813166 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -313,10 +313,10 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then fi if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then logmsg "Restoring the status bar . . ." - lipc-set-prop com.lab126.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}' # 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.pillow interrogatePillow '{"pillowId": "default_status_bar", "function": "nativeBridge.showMe();"}' lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home fi fi