From e0792d3546588059c9f5afb8de08da926f65387c Mon Sep 17 00:00:00 2001 From: ro8inmorgan Date: Sun, 18 May 2025 21:50:58 +0200 Subject: [PATCH 1/4] fix for titles not going fullscreen if there is no gamethumb --- skeleton/SYSTEM/tg5040/bin/suspend | 2 +- workspace/all/nextui/nextui.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/skeleton/SYSTEM/tg5040/bin/suspend b/skeleton/SYSTEM/tg5040/bin/suspend index 5b6715a17..00ec97c38 100755 --- a/skeleton/SYSTEM/tg5040/bin/suspend +++ b/skeleton/SYSTEM/tg5040/bin/suspend @@ -1,5 +1,5 @@ #!/bin/sh -# set -eu +set -euo pipefail exec 0<&- # wpa_running=0 diff --git a/workspace/all/nextui/nextui.c b/workspace/all/nextui/nextui.c index a554f42a7..f60cefef3 100644 --- a/workspace/all/nextui/nextui.c +++ b/workspace/all/nextui/nextui.c @@ -2159,7 +2159,11 @@ int main (int argc, char *argv[]) { int new_w = max_w; int new_h = max_h; had_thumb = 1; - ox = (int)(max_w) - SCALE1(BUTTON_MARGIN*5); + if(exists(thumbpath)) + ox = (int)(max_w) - SCALE1(BUTTON_MARGIN*5); + else + ox = screen->w; + SDL_UnlockMutex(thumbMutex); } From ce51e2c5dc0383e13eed729c28ec12dde6186bab Mon Sep 17 00:00:00 2001 From: ro8inmorgan Date: Sun, 18 May 2025 21:56:01 +0200 Subject: [PATCH 2/4] api.c rollback --- workspace/all/common/api.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/workspace/all/common/api.c b/workspace/all/common/api.c index 464c4e35f..0a4ac041f 100644 --- a/workspace/all/common/api.c +++ b/workspace/all/common/api.c @@ -2872,16 +2872,21 @@ static void PWR_waitForWake(void) { if(sleepDelay > 0) { SDL_Delay(200); if (SDL_GetTicks()-sleep_ticks>=sleepDelay) { // increased to two minutes - // if (pwr.is_charging) { - // sleep_ticks += 60000; // check again in a minute - // continue; - // } + if (pwr.is_charging) { + sleep_ticks += 60000; // check again in a minute + continue; + } if (PLAT_supportsDeepSleep()) { int ret = PWR_deepSleep(); if (ret == 0) { return; + } else if (deep_sleep_attempts < 3) { + LOG_warn("failed to enter deep sleep - retrying in 5 seconds\n"); + sleep_ticks += 5000; + deep_sleep_attempts++; + continue; } else { - LOG_info("failed to enter deep sleep - powering off\n"); + LOG_warn("failed to enter deep sleep - powering off\n"); } } if (pwr.can_poweroff) { From 3d919f76c689bab8422965cc6e7fb58a23471006 Mon Sep 17 00:00:00 2001 From: ro8inmorgan Date: Sun, 18 May 2025 22:16:30 +0200 Subject: [PATCH 3/4] suspend fix --- skeleton/SYSTEM/tg5040/bin/suspend | 76 ++---------------------------- 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/skeleton/SYSTEM/tg5040/bin/suspend b/skeleton/SYSTEM/tg5040/bin/suspend index 00ec97c38..4e7763209 100755 --- a/skeleton/SYSTEM/tg5040/bin/suspend +++ b/skeleton/SYSTEM/tg5040/bin/suspend @@ -1,81 +1,13 @@ #!/bin/sh set -euo pipefail -exec 0<&- - -# wpa_running=0 -# hciattach_running=0 -# bluetoothd_running=0 - -# shellcheck disable=SC2317 resume() { - - - # >&2 echo "Unblocking wireless..." - # echo 1 >/sys/class/rfkill/rfkill0/state || true - - # if [ "$wpa_running" -eq 1 ]; then - # >&2 echo "Starting wpa_supplicant..." - # wpa_supplicant -B -iwlan0 -Dnl80211 -c/etc/wifi/wpa_supplicant.conf -I/etc/wifi/wpa_supplicant_overlay.conf -O/etc/wifi/sockets || true - # udhcpc -i wlan0 & - # fi - - # if [ "$hciattach_running" -eq 1 ]; then - # >&2 echo "Starting hciattach..." - # /etc/init.d/hciattach start || true - # fi - # if [ "$bluetoothd_running" -eq 1 ]; then - # >&2 echo "Starting bluetoothd..." - # /etc/bluetooth/bluetoothd start || true - # /usr/bin/bluetoothctl power on || true - # fi - >&2 echo "Resumed from suspend..." - exit 0 + echo "Resumed from suspend..." } main() { - >&2 echo "Preparing for suspend..." - - # if pgrep wpa_supplicant; then - # wpa_running=1 - # >&2 echo "Stopping wpa_supplicant..." - # killall -9 wpa_supplicant - # fi - # ifconfig wlan0 down - - # if pgrep hciattach; then - # hciattach_running=1 - # >&2 echo "Stopping hciattach..." - # /etc/init.d/hciattach stop - # fi - # if pgrep bluetoothd; then - # bluetoothd_running=1 - # >&2 echo "Stopping bluetoothd..." - # /etc/bluetooth/bluetoothd stop - # killall -15 bluealsa - # fi - - # >&2 echo "Blocking wireless..." - # echo 0 >/sys/class/rfkill/rfkill0/state - - >&2 echo "Suspending..." - max_attempts=20 - attempt=1 - - while ! echo mem > /sys/power/state 2>/dev/null; do - >&2 echo "Suspend attempt $attempt failed. Checking for active wakeup sources..." - awk '{ if ($2 > 0 && NR > 1) print $1 " is active (" $2 " times)"; }' /sys/kernel/debug/wakeup_sources - - if [ "$attempt" -ge "$max_attempts" ]; then - >&2 echo "Maximum suspend attempts reached ($max_attempts). Giving up." - break - fi - - attempt=$((attempt + 1)) - >&2 echo "Retrying in 1 seconds..." - sleep 1 - done - - >&2 echo "Resuming..." + echo "Preparing for suspend..." + echo mem > /sys/power/state + echo "Resuming..." resume } From 7f5d9ebf6420a48694373ed80c84de4056b783d5 Mon Sep 17 00:00:00 2001 From: ro8inmorgan Date: Sun, 18 May 2025 22:19:28 +0200 Subject: [PATCH 4/4] added sync before suspend write --- skeleton/SYSTEM/tg5040/bin/suspend | 1 + 1 file changed, 1 insertion(+) diff --git a/skeleton/SYSTEM/tg5040/bin/suspend b/skeleton/SYSTEM/tg5040/bin/suspend index 4e7763209..318c16d4f 100755 --- a/skeleton/SYSTEM/tg5040/bin/suspend +++ b/skeleton/SYSTEM/tg5040/bin/suspend @@ -6,6 +6,7 @@ resume() { main() { echo "Preparing for suspend..." + sync echo mem > /sys/power/state echo "Resuming..." resume