Repository navigation
fix: keep Linux fullscreen stable and preserve destination state on rotation - #13
Merged
Merged
Conversation
…otation - linux runner: the qrstream/window channel handler wrapped the args from fl_method_call_get_args in g_autoptr, but FlMethodCall owns that reference (fl_method_call_new refs it, dispose unrefs it) — g_autoptr double-unref'd it, tripping fl_value_unref's refcount assertion and crashing the app the moment Fullscreen was pressed. The args are now treated as the borrowed reference they are. - app shell: the destination body moved between two Scaffold layouts at the 600dp breakpoint (body>Column vs body>Row>Expanded>Column), so rotating a phone recreated SendView/SettingsView from scratch and reset their state. The rail slot now always occupies index 0 (NavigationRail when wide, a zero-size placeholder when narrow) with the destination fixed at index 1, keeping the element path stable across the breakpoint so Flutter reuses the existing State instead of rebuilding it.
4 tasks done
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.
What & Why
Two crash / state-loss bugs:
Linux fullscreen crash. The qrstream/window channel handler in the Linux runner wrapped
fl_method_call_get_args(...)ing_autoptr. ButFlMethodCallowns that reference (fl_method_call_newrefs it,disposeunrefs it) —get_argsreturns a borrowed pointer.g_autoptrdouble-unref'd it, trippingfl_value_unref's refcount assertion and corrupting the heap → the app crashed the moment Fullscreen was pressed. The args are now treated as the borrowed reference they are.Rotation resets the destination to home. The destination body sat at different element paths depending on width:
body > Columnon a portrait phone vsbody > Row > Expanded > Columnon landscape. Crossing the 600dp breakpoint (i.e. rotating a phone) therefore unmountedSendView/SettingsViewand mounted fresh ones, discarding the picked file / settings form / send phase. The rail slot now always occupies index 0 (NavigationRailwhen wide, a zero-size placeholder when narrow) and the destination is fixed at index 1, so the element path is identical across the breakpoint and Flutter reuses the existing State instead of rebuilding it.How it was tested
Fullscreen crash: reproduced the exact
fl_value_unrefCRITICAL + crash before the fix (running the app and triggering the channel). After the fix the app runs 12s+ with zero CRITICAL/assertion messages and no crash.Rotation: new regression
rotation across the 600dp breakpoint preserves the SendView State— pumps at 390dp, captures the State identity, resizes across 600dp both directions, asserts the same State survives. Fails on the old shell (State recreated: hash mismatch), passes on the new one.cd flutter_app/rust && cargo build --lib && cd flutter_app && flutter analyze && flutter test— 118 tests pass.flutter analyze+flutter testManually tested on: Flutter Linux (fullscreen no longer crashes)
Checklist