Repository navigation
Android Multi-window - #24397
Android Multi-window#24397MartinZikmund wants to merge 64 commits into
Conversation
|
Claude finished @MartinZikmund's task in 8m 40s —— View job Review complete
Verdict: fix-firstThe core de-singletoning work (per-window 5 findings posted inline, most-severe first:
Nothing here blocks discussion, but #1 in particular should be resolved (doc update or scope walk-back) before merge given it's a direct contradiction between the shipped behavior and the PR's own design record. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24397/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24397/docs/index.html |
|
The build 232104 found UI Test snapshots differences: Details
|
8bd4fed to
4e8a5e0
Compare
|
Claude finished @MartinZikmund's task in 2m 36s —— View job Review complete
Verdict: fix-first (unchanged)This push adds only two small commits since the previous review round:
Both are narrow, low-risk build/compile fixes — no new correctness, lifecycle, or test-coverage issues introduced by them, so no new inline comments. Prior findings — still unresolvedI re-checked the five findings from the previous review pass against the current tree; none have been addressed yet, so they still stand (not re-posted inline to avoid duplicating the existing threads):
Nothing here is new — this is a status check confirming the outstanding items from the 2026-09-04 review still need a decision (doc update vs. scope walk-back for #1 in particular) before merge. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24397/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24397/docs/index.html |
|
The build 233737 found UI Test snapshots differences: Details
|
|
|
4e8a5e0 to
75a4462
Compare
|
Claude finished @MartinZikmund's task in 3m 36s —— View job Review complete
Verdict: fix-first8 new commits landed since the last pass. Good progress on prior findings:
New findings from this batch:
Still unresolved from the prior round (unchanged by this batch, not re-flagged inline):
CI: the Azure DevOps |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24397/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24397/docs/index.html |
75a4462 to
9c98134
Compare
Opening two secondary windows and closing them left "Open secondary Window" dead, throwing "A secondary window can only be opened while an activity is running" on every later click. BaseActivity.Current is claimed from create/start/restart/resume and cleared by ResignCurrent on pause/stop/destroy. With one window that is complete: the only activity always re-claims it on the way back. With several, the others stay started and resumed while the foreground one closes, so none of them ever runs that path -- the closing activity clears the static and nothing sets it again. Traced on a tablet: TopResumed 3 = False (current 3) ResignCurrent 3 (current 3) <- cleared TopResumed 1 = True (current <null>) <- handover ignored OnTopResumedActivityChanged is the authoritative foreground handover between live activities, and it was the one lifecycle callback not claiming Current. Claim it there. This also re-points ContextHelper.Current when the user switches windows, which SetAsCurrent already owns. Not covered by a runtime test: the harness drives a single activity, so two live windows cannot be staged there. Verified on a Pixel Tablet emulator by replaying the report -- open two, close both, re-open -- which now succeeds with no exception. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013abHtN84G3yMS8oM4JxYEF (cherry picked from commit 4419dcc)
Closing a secondary window took three clicks on its Close button. Android was dropping the events before the app ever saw them: Not creating InputTarget for ... PopupWindow:..., no input channel Dropping event because no targets were found: MotionEvent LayoutProvider observes layout and insets through an invisible PopupWindow and relied on Width = 0 to stay clear of touch. That is not enough: the dispatcher still selects the popup as the target for a touch over it, finds it has no input channel, and drops the event outright instead of falling through. One popup is created per activity, so every open window costs another swallowed tap -- which is why the count grew with the number of windows. Mark it not focusable and not touchable so it is never a candidate target. Verified on a tablet emulator: open, close and re-open a secondary window all respond to a single press, with zero dropped events across the run. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013abHtN84G3yMS8oM4JxYEF (cherry picked from commit 094c066)
UpdateCanPasteClipboardContent runs on every TextBox focus change and called Clipboard.GetContent() purely to decide whether Paste should be enabled. Reading the clipboard is user-visible on Android 12+, which answered with a "pasted from your clipboard" notice on app launch and again whenever focus returned to a text box. Clipboard.ContainsText() answers from the clipboard's description where the platform can tell without reading -- on Android PrimaryClipDescription, which does not count as a read -- and falls back to the previous content check elsewhere, so no other target changes behaviour. Pasting still reads, which is when the notice belongs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013abHtN84G3yMS8oM4JxYEF (cherry picked from commit 0c8a7c1)
AppWindowClosing exercises closing semantics and its secondary window is deliberately bare, which makes it a poor way to see multi-window working. This one opens windows that are visibly distinct -- their own accent, index and running clock -- so several of them side by side show at a glance that each is a separate visual tree rendering on its own. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013abHtN84G3yMS8oM4JxYEF (cherry picked from commit 47c7fa4)
AndroidX.Activity also exposes an ActivityFlags type, so the unqualified reference was ambiguous with Android.Content.ActivityFlags (CS0104). The global:: alias is needed because Android resolves to Microsoft.Android inside the Microsoft.UI.Xaml namespace. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit 5101df7)
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit 4fa8dc4)
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit 8fe5fed)
The plan listed the live second Activity as an out-of-scope follow-up, which this branch delivers. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit 3236c64)
The helper was added without switching the caller, so it was dead code and the instance method still wrote the static field. The plan also kept two lines asserting the narrower scope, contradicting the paragraph recording that the live second activity lands here. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit ecbe3bb)
Closing a window finishes the task hosting it rather than unloading its tree, so the presenters never detach their native elements and the tracking entries kept the views -- and through them the finished activity -- alive for the rest of the process. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01RcQhNLcUU4zKcbgRaWZUAR (cherry picked from commit aa3a3c2)
Uno.UI builds once and calls Clipboard.ContainsText, but it lived in Clipboard.cs, which the tvOS variant compiles out. Focusing a TextBox on tvOS then threw MissingMethodException. Move it to a file every variant compiles, falling back to GetContent where the platform cannot answer from the clip description. Android reads the description through the application context, which is all a ClipboardManager needs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Each window is an activity, and stopping one raised the app-wide EnteredBackground and Suspending while other windows were still visible. Track the started activities and raise them only when none is left, and not for a configuration-driven re-creation, whose replacement starts right away. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
- Report a secondary window shown and activated only once an activity adopted it; a close before that cancels the launch, and an activity started for a window nobody knows finishes instead of taking over the main window from a live activity (process-death restore). - Keep the main window reusable across close, as on single-window targets: Android keeps the process and the next launch shows it again. Closing it finishes its activity rather than leaving it blank. - Release a permanently closed window: unregister its XamlRoot, native elements and process-wide subscriptions, whether the app or the system closed it, and report a system close only once. - Keep a title set before the window had an activity. - Place native elements loaded before the window had an activity. - Route back and close popups per window: the process-wide SystemNavigationManager only serves the main window. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
The explore-by-touch helper hit-tested and navigated the main window's tree from every render view, so TalkBack in a secondary window acted on the main window's elements. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Closing a window that never had an activity releases its host, a title set before activation is kept, and only secondary windows close for good. Activating a secondary window on Android starts a task of its own, which backgrounds the test runner, so tests that do are skipped there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Clipboard is static in WinAppSDK, and the sync generator rejects a non-static declaration of it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
tvOS now declares Clipboard for ContainsText, so the class is no longer not-implemented there as a whole; its members still are. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Windows.UI.Colors is not part of the WinUI contract and is gone from master. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
SetContent described plain text as "text/plaintext", which is not a MIME type Android or other apps know, so the clip description never reported text: other apps did not see Uno's clips as text, and ContainsText kept Paste disabled for Uno's own. Write text/plain, and still recognize the old label on clips written by earlier versions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Gating the activation on WasShown broke secondary windows on UIKit, which defers its show until the scene connects in the same way and relied on the activation being raised on request. Android no longer needs the gate: a close from an Activated handler now cancels the pending launch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4
Route the started-activity count through an Interlocked helper and filter CancelLaunch with Where. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
56924ce to
127fdb7
Compare
|
Claude finished @MartinZikmund's task in 1m 52s —— View job Review complete
Verdict: fix-first (unchanged)No new commits landed content-wise since the last full review pass.
That last point matters because it means the one standing P1 finding is still open on this exact code: Not re-flagging anything else: nullability, CI for this fresh push was still queued/in-progress at review time (CodeQL, WinAppSDK Sync Generator Check, Check Links, Code Quality, PR Labeler all pending; XAML Style Check passed). The prior |
|
|
||
| private class InAppReviewListener : Java.Lang.Object, IOnCompleteListener | ||
| { | ||
| private StoreContext _storeContext; |
| _vulkanContext.Dispose(); | ||
| if (_nativeWindow != IntPtr.Zero) | ||
| { | ||
| ANativeWindow_release(_nativeWindow); |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24397/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24397/docs/index.html |
|
The build 237227 found UI Test snapshots differences: Details
|
|
|
GitHub Issue: #8341
PR Type:
✨ Feature
What changed? 🚀
Turns on live multi-window for Skia-Android:
SupportsMultipleWindowsistrue, and everysecondary
Windowis hosted by its ownApplicationActivity, launched in a task of its own(
NewDocument | MultipleTask) and tagged with the window's id.starts adopts the window by id, builds its render stack and only then reports the window shown (activation
is raised on request, as on UIKit). A close while the launch is pending cancels it. An activity started for a window this
process does not know (closed meanwhile, or restored after process death while another activity
drives the main window) finishes instead of taking the main window over.
(
XamlRootMap, native elements, title-bar/DPI/theme subscriptions). The main window keeps thesingle-window semantics it has on master (hidden, content kept, shown again on the next launch),
because Android keeps the process after the main task finishes. This also fixes a crash where
relaunching after the main task finished re-adopted a closed window.
EnteredBackground/Suspendingfire when the last activity stops, not per window.accessibility (explore-by-touch) and light-dismiss popups are scoped to the owning window; the
foreground activity is claimed on top-resume; caption-bar insets in freeform windows.
SystemNavigationManageris process-wide, so it only serves the main window; a secondarywindow keeps the system behavior (back closes it).
Clipboard.ContainsText()asks the clip description rather than reading the clipboard (no"pasted from your clipboard" notice on every focus change), and is compiled for every
Uno.WinRTvariant (tvOS was missing it).
MultiWindowShowcasesample.Known gaps (process-wide IME binding before activation,
InputPaneocclusion,DisplayInformation,StatusBarinsets listener, deep-link re-handling, native-viewContextafter re-creation) are listedin
specs/053-android-multiwindow-ready/plan.md; each has an additive fix.Validation
Uno.UI.Runtime.Skia.Androidfornet10.0-androidbuilds clean, including a strictbuild (analyzers on);
Uno.UI.RuntimeTests.Skiabuilds.Given_AndroidSkiaXamlRootHostcovers releasing a window closed beforeactivation, keeping a title set before activation, and main vs secondary close semantics on the
Android Skia lane. Tests that activate a secondary window are skipped on Android: the new task
backgrounds the test runner.
MultiWindowShowcasesample.PR Checklist ✅
MultiWindowShowcase)Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01DtsKbXbA642EduoduiNtt4