* Add missing AutomationPeers from built-in Controls.
* revert native menu bar peers
* Add back a thin automation peer for native menu bar.
* Use ColorChanged for ColorSpectrumAutomationPeer
* Fix NativeMenuBar/ColorSpectrum automation peer regressions
Flatten MenuItem children under NativeMenuBarAutomationPeer and raise ColorChanged when Color is set directly so ColorSpectrumAutomationPeer notifies AT clients.
* Drop NativeMenuBarAutomationPeer.GetChildrenCore override
Bisect confirmed this override caused 5 Windows IT tests (Slider, Screen, DragDrop) to fail by producing an inconsistent UIA tree where MenuItem peers list NativeMenuBar as parent while their visual parent is the inner Menu. Reverted to the thin peer that only reports ControlType=MenuBar, and dropped the now-irrelevant children assertion test.
* Prototype an AABB tree for hit testing
* Some optimizations
* Revert runtime knobs and add tests
* Avoid rebuilding the whole tree
* Revert an invalid optimization
* Add a hit test page
* Clean up
* Format code
* Nit
* Use weak CompositionVisual reference in server-side
* Bucket composition hit-test AABB tree by child order
* Use readback revisions for AABB hit-test updates
AutomationElementIdentifiers.AutomationIdProperty was missing, so
runtime changes to AutomationProperties.AutomationId never raised
UIA_AutomationPropertyChangedEventId on Windows (or the equivalent
on macOS). UIA clients that subscribe to property changes would
silently receive stale automation IDs.
- Add AutomationIdProperty sentinel to AutomationElementIdentifiers
- Raise the event in ControlAutomationPeer.OwnerPropertyChanged
when AutomationProperties.AutomationIdProperty changes
- Add AutomationIdProperty -> UiaPropertyId.AutomationId to the Win32
AutomationNode.s_propertyMap
- Add AutomationPeer_AutomationId to AvnAutomationProperty (avn.idl)
and wire it in AvnAutomationPeer.s_propertyMap and automation.mm
- Add unit tests covering runtime AutomationId change notifications
When the iOS app uses scene-based lifecycle (iOS 13+), Apple delivers
cold-launch user activities and URL contexts via UISceneConnectionOptions
on scene:willConnectToSession:options: — NOT via the warm-path selectors
scene:continueUserActivity: or scene:openURLContexts:. AvaloniaSceneDelegate
ignored connectionOptions entirely, so cold-launching the app from a
Universal Link or custom-scheme URL dropped the URL on the floor.
The user's subscriber to IActivatableLifetime.Activated then only saw
the base ActivatedEventArgs raised by the foreground transition
(OnLeavingBackground), never a ProtocolActivatedEventArgs with the URL.
Fix: in WillConnect, after the window is created and made key, drain
both connectionOptions.UserActivities and connectionOptions.UrlContexts
through the existing IAvaloniaAppInternalDelegate paths. Also add a
scene:openURLContexts: handler so warm custom-scheme URLs work under
scene lifecycle (previously these were silently dropped too —
application:openURL: on the AppDelegate is not called when scenes are
in use).
Closes#21362 (cold path of #17600 / #18005).
The IAvaloniaAppInternalDelegate interface gains an OpenUrl(NSUrl)
method so the scene delegate can route URL contexts through the same
code path the existing application:openURL:options: AppDelegate handler
uses.
No new tests — the Avalonia.iOS UnitTests and IntegrationTests projects
don't currently exist in the repo. Manual verification steps in the
issue: build any Avalonia.iOS app with Associated Domains entitlement
+ AASA served, force-quit, tap a Universal Link, observe the
Activated event fires with ProtocolActivatedEventArgs (not base
ActivatedEventArgs). Happy to add a test if maintainers can point at
a scene-lifecycle test fixture to model from.
* [Text] Move Unicode trie generation to a dedicated Nuke-driven tool
The trie and enum generators used to live as [Fact(Skip = ...)] tests in
Avalonia.Base.UnitTests, writing to a local Generated/ folder that had to
be hand-copied into src/Avalonia.Base/Media/TextFormatting/Unicode/. Move
them into a standalone tool project invoked by a new GenerateUnicodeData
Nuke target that writes the canonical files in place.
- New src/tools/Avalonia.UnicodeTrieGenerator console app (mirrors the
GenerateCppHeaders pattern), signed via SharedVersion.props and added
to Avalonia.Base's InternalsVisibleTo for UnicodeTrieBuilder access.
- UCD downloads are cached under artifacts/ucd-cache/<version>/ so
reruns work offline; the target accepts --output and --cache args.
- LineBreakClass and WordBreakClass orderings now come from
PropertyValueAliases (with hot-path tags seeded at the front for
cache density), removing the BreakPairTable.txt resource and the
dead BreakPairTable.cs writer that nothing in src/ referenced.
- ParseDataEntries dedupes by Name OR Tag so seeds can use friendlier
names (Carriage_Return) than UCD's WB primaries (CR).
- Deprecated WB classes (E_Base, E_Modifier, Glue_After_Zwj,
E_Base_GAZ) are filtered out — they have no codepoint mappings.
- Conformance tests stay in the test project, repointed at a small
UnicodeTestData.Ucd constant.
Regenerating into the canonical Unicode directory produces a zero diff
against the previously committed enums and tries, confirming the port
preserves output byte-for-byte. Invoke with `./build.cmd GenerateUnicodeData`.
* Align generated file names
Validate all tries
Unify UCD path
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Make the trie generation standalone
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Added macOS events for expand & collapse events
* Fix CFString bridging to NSString
* Don't use ExpandCollapseProvider functions when event was not for ExpandCollapseProvider
---------
Co-authored-by: Adam Demasi <adam@hbang.com.au>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Allow Dispatcher to be implicitly cast to TaskScheduler
* API change requests
* Cache one scheduler per priority
* Cache a TaskScheduler in each sync context
* Add word break support and use it for ellipsis
* Regenerate Unicode text-formatting data to v17 and fix issues
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Fix#20625: fix compiled binding DataContext inference in ItemTemplate
The Sandbox repro failed with AVLN2100/AVLN2000 when compiled
bindings were used with ItemTemplate and name-based DataContext
access.
Root causes:
- No fallback DataContext type was inferred for the root object when
x:DataType was absent.
- Name-scope lookup could capture stale DataContext metadata from an
unrelated traversal branch, causing #ListBoxRoot.DataContext to
incorrectly resolve to the item type.
Fixes:
- Add root-level DataContext fallback inference in
AvaloniaXamlIlDataContextTypeTransformer.
- Update ScopeRegistrationFinder to resolve DataContext from the
current ancestor stack when the matching name is found.
- Preserve first-match semantics and prefer root namescope lookup
before deferred scopes in name binding resolution.
- Add and expand unit tests for ItemTemplate and nested namescope
scenarios, including mismatched runtime DataContext behavior.
Signed-off-by: João Cruz <joaosantaremdacruz@tecnico.ulisboa.pt>
* Fix#20625: simplify compiled binding regression tests
Address review feedback to reduce test complexity in XamlIlTests.
This change removes per-test UserControl helper classes and command
scaffolding that were not required to validate the compiler behavior.
Tests now use inline XAML in each [Fact] and shared lightweight mock
types for root and item data.
The compiled binding scenarios are still covered, including root
fallback inference and named DataContext resolution with ItemTemplate
and nested namescopes, but with less boilerplate and better readability.
* Fix#20625: remove automatic DataContext fallback to root type
Address review feedback by removing the automatic fallback inference
to the root type in AvaloniaXamlIlDataContextTypeTransformer, as it
is not necessary to fix the issue and is not desired behavior.
Also removes the unit tests that validated this specific fallback.
---------
Signed-off-by: João Cruz <joaosantaremdacruz@tecnico.ulisboa.pt>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Make sure TryGetGlyphTypeface does not fail for concurrent access
* Update tests/Avalonia.Base.UnitTests/Media/FontManagerTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update gitignore
* Make TryGetFontCollection more robust and add unit tests
* Introdcue GetOrCreateFontCollection helper for safe disposal of losing instances
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* ensure system back event is passed to child page once
* fix formatting in DrawerPage
* add tests
* add back default page handler for system back event, but only check OnSystemBackButtonPressed
* removed `OnSystemBackButtonPressed` checks in derived page classes
* nav page - send back event to current page before modal pages.
* Fix modal-first system back routing in NavigationPage
---------
Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Addresses path traversal vulnerability GHSA-6c8g-7p36-r338
(CVE in IArchive.WriteToDirectory) which affects all versions
<= 0.47.4. Version 0.48.0 is the first non-vulnerable release
per the NuGet vulnerability API.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return null when an IPresentationSource can't convert from/to screen coordinates
Document exceptions in VisualExtensions PointToClient and PointToScreen
Add tests for cross-root pointer event positions
* Run Win32 file picker on a dedicated thread to avoid MTA deadlock
* Add threading comment in Win32StorageProvider
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Update HarfBuzzSharp and SkiaSharp package versions
https://github.com/mono/SkiaSharp/releases/tag/v3.119.4-preview.1.1
SkiaSharp v3.119.4-preview.1.1 has many features:
Add SkiaSharp.Views.Gtk4 using GirCore.Gtk-4.0 bindings
Add Linux Bionic native assets support, that can make high-performance Android application
Add PolySharp for C# 13 support on legacy TFMs
Add Tizen x64 and arm64 native build support
Delay-load D3D12 DLLs to prevent crashes on systems without DX12
Bump Skia milestone from 119 to 133
* Restore HarfBuzzSharp version
* Fix headless cleanup race: dispose before signalling TCS (#20664)
Restructure DispatchCore<TResult> so application.Dispose() runs in a
finally block before tcs.TrySet* is called. Previously, the using-var
scope closed after TrySetResult, leaving s_uiThread set when the next
non-headless test started.
Adds a regression test in IsolationTests that verifies Dispatcher.UIThread
is accessible from the calling thread immediately after a headless dispatch
completes (PerTest isolation only).
* Use Assert.SkipWhen in Dispatch_Cleanup_Should_Complete_Before_Task_Returns
* Restrict Dispatch_Cleanup_Should_Complete_Before_Task_Returns to NUnit
xUnit's AvaloniaFactDiscoverer wraps every [Fact] in session.Dispatch,
so awaiting another session.Dispatch inside the test body deadlocks on
the session's single background thread.
* Remove new test
It isn't reliable enough during CI.
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* mark ToplevelImpl._view as nullable.
* Update src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* return 1 as default scaling in android TopLevelImpl
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>