gui2: decrypt, backup, mount and wipe pages, plus input and rendering fixes - #31
Open
lingqiqi5211 wants to merge 20 commits into
Open
lingqiqi5211 wants to merge 20 commits into
lingqiqi5211 wants to merge 20 commits into
Conversation
A single non-blocking flip that returns an error permanently cleared atomic_page_flip, so every later frame took the blocking ALLOW_MODESET commit path for the rest of the session. The flag is only restored by drm_init()/drm_exit(), so the UI stayed pinned to vblank once anything went wrong. Blanking the panel is enough to trigger it: the GUI keeps submitting while the CRTC is disabled and the flip fails with -EINVAL. Only leave the non-blocking path after several consecutive failures, reset the counter on success, and stop presenting entirely while the display is blanked.
backend_index only ever moved forward and was reset in Initialize() and Release(), so once every backend had refused a boost once the manager could never raise the clocks again for the rest of the session. Start over from the first backend when the list is exhausted so a transient refusal no longer disables boosting permanently.
Three separate problems made dragging lag or break: The read callback delivered a single touch frame per call while the digitizer reports at ~135 Hz and the loop reads at ~100 Hz, so the queue grew and the UI showed a position from several frames ago. Set continue_reading so LVGL drains what is pending. Draggable widgets did not set LV_OBJ_FLAG_PRESS_LOCK, so LVGL re-resolved the object under the finger on every pressing iteration and sent PRESS_LOST as soon as the touch drifted off a thin control. Both sliders jumped when grabbed because the press mapped the touch point straight onto the knob centre. Track the grab offset instead, and let the value slider move only when the knob itself is grabbed. Also give the value slider a disabled state that dims the indicator and knob and rejects drags.
The page root was transparent, so during a transition the outgoing page's heading showed through the incoming one: two titles and two version labels rendered on top of each other, and one vanished when the old page was finally deleted. The version label was also sized to exactly its measured text width while still in wrapping mode, which let the last glyph fall off, and it was positioned without accounting for the heading's left padding. Draw each page opaque, and give the label an explicit box with room to spare, clipping, right alignment and a padding-aware position. Reserve the bottom inset from the scroll viewport instead of padding it, so pages with an apply button clip their content at the button rather than letting it run underneath.
A finished screenshot only triggered the white flash; the saved path was never shown, and the strings for it were unused. Screenshots close the panel before capturing, so the result now waits and is shown the next time the panel is opened, once. The panel also fired its open callback twice per pull-down, which cleared that pending result immediately, and a press that dragged the panel could still be delivered as a button click on release. Collapse the feedback row when it has nothing to say, widen the gaps between the brightness slider, the action row and the feedback, and let the controller resize itself when the row appears.
The bottom navigation already carried a console action that nothing handled. Add the page behind it, reading the recovery console the legacy GUI owns through a new read-only accessor so both UIs share one buffer, and refresh it from the loop while the page is on top. Add the settings that were still missing: a screen timeout switch and duration slider writing tw_screen_timeout_secs, a console font size, and log export under Advanced with switches for the kernel log and logcat.
Member
|
@codex review |
The connector lists 60 Hz first, so the UI ran at 60 Hz on panels that also report 144 and 165 Hz.
gui2 never initialises the legacy PageManager, so GetResources() returns
null and gui_parse_text()/gui_lookup() dereferenced it. Get_Partition_List
reaches this through the {@dalvik} entry of its wipe list.
Log export picks several entries at once, which reads as a selection rather than as a set of switches.
Eight steps from 15 s to 10 minutes, with no timeout at the far right, so the toggle is no longer needed.
Factory reset, advanced wipe and format data, with progress reported through an embedded console view.
The console lines wasted a card's worth of padding, and the reboot targets were smaller than every other list on screen.
Member
|
啥情况了 |
Console strings are resolved out of the loaded theme's resource list, which GUI2 never loads. Give the message catalogue a hook so a UI can resolve a key itself before the normal lookup runs.
Loading the legacy language XML is not an option: its resource list starts with font overrides that expect the font stack GUI2 replaced, and walking into it crashes. Carry the strings in a table of their own and install it through the new hook.
Wiping was the only thing with a progress page, but decrypt and backup want the same console-and-bar layout. The embedded console also has to own its viewport here, so long output scrolls instead of growing the page past the bar.
A button is too easy to hit by accident for something that erases the whole data partition. Confirm with a slider that stays disabled until yes is typed, and draw the warning from a vector rather than scaling a font glyph up until it blurs.
The three share the same wiring, page state and strings, so they arrive together. Decryption follows the legacy flow for user 0 with a password, pattern or PIN, and takes the page over at startup; the legacy prompt now only runs when GUI2 could not start. Until data is unlocked the home page carries a notice back to it.
A confirmed gesture never reaches accept_click, so every slide-to-confirm was silent while ordinary buttons buzzed.
Left behind by the pages that stopped referring to them.
Nothing handled the keyboard's close request, so the decrypt page could never dismiss it, and because the keyboard lives on the top layer, clearing only the pointer left it sitting over every later page. The stock layout offers that key in one corner alone, drawn with a keyboard glyph that reads as "show". Carry a hide arrow in both bottom corners and on the number pad instead, and put the keyboard away once a passphrase is confirmed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested on a Xiaomi SM8750 device (warsaw) running the
lvglbranch.Fixes
A blanked panel permanently degraded the whole session. The GUI keeps
submitting frames while the CRTC is disabled, the non-blocking flip fails with
-EINVAL, andatomic_page_flipwas cleared for good — every later frame tookthe blocking
ALLOW_MODESETpath. The flag is only restored bydrm_init()/drm_exit(). Now the backend only leaves the non-blocking pathafter repeated consecutive failures, and GUI2 stops presenting while blanked.
Dragging did not follow the finger. Three causes: the read callback
delivered one touch frame per call while the digitizer reports at ~135 Hz and
the loop reads at ~100 Hz, so the queue grew and the UI trailed by several
frames; draggable widgets did not set
LV_OBJ_FLAG_PRESS_LOCK, so LVGLre-resolved the object under the finger each pressing iteration and sent
PRESS_LOSTwhen the touch drifted off a thin control; and both sliders jumpedon grab because the press mapped the touch point onto the knob centre.
Page transitions stacked two headings. The page root was transparent, so the
outgoing page's title and version label showed through the incoming one and
disappeared when it was deleted.
A finished screenshot never reported its path — only the white flash fired,
and the strings for the result were unused.
TwrpPerfManagerdemoted boost backends permanently.backend_indexonlymoved forward and was reset in
Initialize()/Release(), so once every backendhad refused once, clocks could never be raised again for the rest of the
session.
Opening advanced wipe killed the process.
gui_parse_text()andgui_lookup()dereferencePageManager::GetResources(), which is null undergui2 because the legacy
PageManageris never initialised.Get_Partition_List("wipe", …)reaches it through the{@dalvik}entry of itslist, so the page segfaulted and init restarted recovery every five seconds,
leaving the device on the first frame with nothing in
/tmp/recovery.log. Bothhelpers now fall back the way
twmsg.cppalready does.The UI ran at 60 Hz on a 165 Hz panel. The mode search took the first entry
matching the boot resolution and the connector lists 60 Hz first. It now keeps
the highest refresh rate offered at that resolution.
The keyboard could not be put away. Nothing handled the close request LVGL
sends for its keyboard glyph, so pressing it did nothing. The decrypt keyboard
also lives on the top layer and page changes only cleared the pointer to it,
leaving it over every later page.
Console output ignored the UI language. Those strings are resolved out of
the loaded theme's resource list, which GUI2 never loads. Loading the legacy
language XML is not an option either: its resource list starts with font
overrides that expect the font stack GUI2 replaced, and walking into it crashes.
The message catalogue now takes a translator hook, and GUI2 installs a table of
its own.
A confirmed swipe was silent while ordinary buttons buzzed, because a
gesture never reaches
accept_click().Features
user 0. It takes the page over at startup, so the legacy prompt now only runs
when GUI2 could not start, and the home page carries a notice back to it while
data is still locked.
with a slider that stays disabled until
yesis typed, rather than a buttonthat is easy to hit by accident, and the warning is drawn from a vector rather
than a font glyph scaled up until it blurs.
embedded console owning its own viewport so long output scrolls instead of
growing the page past the bar.
handled before. It reads the recovery console the legacy GUI owns through a
new read-only accessor, so both UIs share one buffer.
timeout, which replaces the earlier switch and free slider.
pad, drawn with a hide arrow rather than a keyboard glyph that reads as
"show".
entries at once rather than toggling independent settings.