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

BLF Menu lockup in certain circumstances #1337

Merged
merged 6 commits into from
Dec 22, 2023
Merged

BLF Menu lockup in certain circumstances #1337

merged 6 commits into from
Dec 22, 2023

Conversation

XK9274
Copy link
Member

@XK9274 XK9274 commented Dec 21, 2023

If you get segfaults with this PR, run this in terminal before (The max value is no longer 5):

rm -rf /mnt/SDCARD/.tmp_update/config/display/blueLightLevel

  • Remove "None" - it's redundant and causes issues
  • Fix menu lockup when scrolling, check if BLF is actually on before setting "blf_changing = true;" to negate needlessly locking the menu items. The artificial lockup on menu items is only needed when BLF is actually changing to avoid race conditions and pulling the display settings out of sync (causes flickering/bad previous state of RGB values, etc)

Fixes: ddc9a9a#commitcomment-135316788

This is only a fix for when in the tweaks menu. The artificial delay is required. Setting display values into the screen gives no easy way to read them besides saving to file (this feature runs inside and outside tweaks so it's a settings value that's bitshifted).

Ideally this feature should run on a command queue/buffer and be processed as they come in so we don't have to try and keep sync...

It would also be great to get a "spinner" as discussed in discord, for when we don't need a full dialog, but need to show the user that something is happening in the background.. Something to look at in tweaks for the future i think.

- Remove "None" - it's redundant and causes issues
- Fix menu lockup when scrolling, check if BLF is actually on before setting "blf_changing = true;" to negate needlessly locking the menu items. The artificial lockup on menu items is only needed when BLF is actually changing to avoid race conditions and pulling the display settings out of sync (causes flickering/bad previous state of RGB values, etc)
XK9274 referenced this pull request Dec 21, 2023
- toggle is now a toggle menu icon
- menu item for toggle and intensity are disabled while script is
working to keep the sync (lock file in tmp)
- intensity now changes in realtime & smooth fade
- add hotkey of Menu + B for 2 seconds to enable BLF
- some UI/fading improvements
- tidy up
- persistent across boots if manually enabled in tweaks via "Toggle now"
- Ignore the schedule for the current session if a manual toggle is done
with the hotkey (saves going into tweaks when it's bouncing) The logic
behind this is:
- If the user disables the BLF for some reason while schedule is enabled
we'll skip the schedule for this session, the user can remove this flag
(/tmp/.blfIgnoreSchedule) by flipping the schedule on/off.

- I chose this method of wiping the schedule flag so if the user takes
no action, when they restart the schedule is still on for the next
session.

---------

Co-authored-by: XK9274 <XK9274@users.noreply.github.com>
Co-authored-by: Schmurtz <schmurtz@gmail.com>
Copy link
Member

@schmurtzm schmurtzm left a comment

Choose a reason for hiding this comment

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

Great improvement ! I'm not able to triggers any failure in my test.

Yes there is a delay when we set the strength level, so yes the spinner could be a beautiful refinement (not an absolute mandatory because once setted you don't modify it every day imo).

As alternative, instead creating a complex SDL spinner you could just change dynamically the "Stength" label like this :
Stength -> Stength. -> Stength.. -> Stength... -> Stength -> Stength. -> Stength.. ,etc..

@schmurtzm schmurtzm added this pull request to the merge queue Dec 22, 2023
Merged via the queue into main with commit a22dbbc Dec 22, 2023
3 checks passed
@schmurtzm schmurtzm deleted the fix-menu-lock-BLF branch December 22, 2023 00:38
@XK9274 XK9274 changed the title FIX: BLF Menu lockup in certain circumstances BLF Menu lockup in certain circumstances Jan 6, 2024
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.

2 participants