426 Commits

Author SHA1 Message Date
Julien Lebosquain 816fb91d4e Move GetWindowsZOrder to IWindowingPlatform (#20633)
* Move GetWindowsZOrder to IWindowingPlatform

* Update API suppressions
2026-02-10 11:08:16 +00:00
Nikita Tsukanov 697cba7193 Composition system SP1 (#20497)
* baseline benchmark

* Composition system SP1

* Allow reusing the same BitmapCache object for multiple visuals

* Fix warnings

* Address review

* API suppressions

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2026-02-06 11:15:47 +00:00
Julien Lebosquain 4c3c9aa99f Add AlphaFormat to ILockedFramebuffer (#20556)
* Add AlphaFormat to ILockedFramebuffer

* Update API suppressions
2026-01-30 09:55:40 +00:00
Julien Lebosquain 3c88142694 Make Screen abstract (#20529) 2026-01-24 09:41:04 +00:00
Benedikt Stebner e8424283fe Universal GlyphTypeface implementation (#19852)
* Introduce a universal IGlyphTypeface implementation that does not rely on any platform implementation

* Revert changes

* Fix Android

* Make the test happy

* Fix build

* Update baseline

* Fix naming

* Fix headless

* Move interfaces to dedicated files
Make GlyphTypeface.GlyphCount an integer

* Fix GlyphCount

* Make IGlyphTypeface NotClientImplementable

* Make sure we cache platform typefaces by their desired name, style, weight and stretch

* Update baseline

* Only use IGlyphTypeface

* Fix Android

* Try to clear the buffer before we encode somethimg

* Add needed test font

* Add more unit tests

* Reduce allocations

* Remove Direct2D1 test files

* More tests

* More complete table implementations

* More adjustments

* Use batch APIs

* Handle invalid timestamps

* Update baseline

* Introduce a CharacterToGlyphMap struct for faster access

* Remove AggressiveInlining

* Remove AggressiveInlining

* Make the head table optional for legacy fonts

* Remove Load method. Fix TextBlockTests

* Fix nullables

* Remove redundant folder

* Update Api baseline

* revert diff helper changes

* revert changes

* Use bare minimum font for Headless platform and introduce a test font manager that uses the Inter font for testing.

* Add missing font file for Headless platform

---------

Co-authored-by: Gillibald <stebner@avaloniaui.net>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2026-01-09 15:07:28 +00:00
Youssef Victor c9e210eb70 Update to xunit.v3 (#20331)
* Update to xunit.v3

* Little more progress

* More fixes

* Keep VSTest supported

* Adjust Nuke

* Few fixes

* Fix for xunit 2

* Fix GetData override

* Adjust

* Use MTP for xunit 2

* Fix test

* Better fix

* --no-progress

* Few more fixes

* no progress

* Fix test

* Better fix

* TRX

* Move to Directory.Build.props

* Unify on MTP v2

* Update

* Update to stable

* 1.0.1

* 1.0.2

* Fix some warnings

* Fix more warnings

* Fix more warnings
2026-01-08 20:46:44 +00:00
Julien Lebosquain 960cb39414 Enable nullability in Controls.UnitTests (#20373) 2025-12-30 09:10:37 +00:00
Julien Lebosquain c68111294f Enable nullability in Base/Markup/Markup.Xaml unit tests (#20346)
* Enable nullability in UnitTests

* Enable nullability in Base.UnitTests

* Enable nullability in Markup.UnitTests

* Enable nullability in Markup.Xaml.UnitTests
2025-12-29 09:24:49 +00:00
Julien Lebosquain 64b63fa5d2 Fix common warnings (#20311) 2025-12-19 11:45:30 +00:00
Tom Edwards b7cb9e5770 Unify selection event handling for all SelectingItemsControl types plus TreeView (#19203)
* Unify selection event handling for all SelectingItemsControl types plus TreeView
- Controls can decide whether to select on press/release, or introduce their own logic
- Container types handle events and can decide whether to forward them on to their owner
- Corrected various cases where controls checked whether a button was held when the event occurred, rather than whether it triggered the event
- Replaced various hardcoded modifier key checks with uses of PlatformHotkeyConfiguration
- ListBox no longer cares if you swipe before releasing touch (unless that triggers a gesture)
- TreeViewItem is now selected on touch/pen release

* API change requests

* Review comments
2025-12-16 17:54:58 +00:00
Benedikt Stebner 3e62621aaf Improve FontCollection customization (#19756)
* Improve FontCollection user story

* Make adjustments after review

* Refactor IsFontFile

* Make FontFamilyLoader internal
Make tests happy again

* Update baseline

* Adjust modifier

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2025-11-24 16:23:32 +00:00
Julien Lebosquain 246cbfc566 Remove Direct2D1 (#20132) 2025-11-24 11:50:03 +00:00
Julien Lebosquain 40a3af4aa5 Remove netstandard2.0 from almost all projects (#20111)
* Remove netstandard2.0 from almost all projects

* Fix duplicated target frameworks in unit tests

* Fix DesignerSupport tests

* Fix Designer.HostApp packaging

* Build ControlCatalog.Desktop on CI

* Fix another bad auto merge

* Fix LeakTests duplicated target frameworks

* Don't hardcode target framework in DesignerSupportTests
2025-11-21 09:59:39 +00:00
Julien Lebosquain fb0f3848f9 Update to .NET 10 (#19869)
* Update to .NET 10 and C# 14

* Remove reflection usage in AvaloniaAccessHelper

* Fix Android nullability errors

* Fix WindowMetrics.WindowInsets removed from AndroidX

* Update pipelines

* Fix ValidateApiDiff for missing frameworks

* Fix Windows integration tests

* Update Xamarin.AndroidX.Window to 1.5.0

* Fix MacCatalyst supported version

* Remove unused Xunit.Extensions.Ordering

* Try to fix macOS integration tests

* Update pipeline runner to macOS 15

* Disable LeakTests

* Fix .NET Framework unit tests

* Fix BuildTests

* Bump minimum Android API level to 24

* Update to .NET 10 RTM

* Update XamlX

* update android insets and activity code to handle deprecated behaviors in api 36

---------

Co-authored-by: Emmanuel Hansen <emmausssss@gmail.com>
2025-11-19 15:22:43 +01:00
Benedikt Stebner 5bed0cb7b6 FontLoading adjustments (#19538)
* Adjust FontFamily parsing so non system fonts require a specific format

* Change relative Uri detection so it uses Contains
2025-08-27 14:26:39 +00:00
Benedikt Stebner 51443cb089 Fix FontCollection MatchCharacter (#19494)
* Fix FontCollection.MatchCharacter usage inside the FontManager implementation
Fix default MatchCharacter implementation
Add a unit test

* Reuse existing font collection key

* Fix resm FontFamilyIdentifier

* Fix FontFamily definition

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2025-08-24 15:39:22 +00:00
Julien Lebosquain a8fed229f6 Fix font memory leak in tests (#19514) 2025-08-24 13:18:17 +00:00
Emmanuel Hansen 22eb8e6ec3 Focus Traversal Api (#18647)
* add focus traversal

* add control focus search overrides

* fix whitespace

* rebased and updated api

* update tests, make focusmanager constructor public

* fix tests

* fix whitespace issue

* addressed comment

* add more tests

* remove redundant private focus  state. fix tests

* Update FocusManager.cs

* fix constructors

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2025-08-24 08:19:21 +00:00
Emmanuel Hansen 230159c174 Use captured element if available as source for tap gestures (#19222)
* update mouse test to better simulate clicks on captured controls

* add tap failing test

* use captured element if available as source for tap gestures
2025-07-30 09:34:39 +00:00
Maxwell Katz 338a5ea0a2 Improve pen secondary button handling on list box (#18766)
* Only start ScrollGesture when left click pressed, also `GetCurrentPoint(null)` behaves the same as root visual

* Allow right-click pen to select items on press

* Add context menus to even items on ListBox page for testing

* Avoid global static in UpdateSelectionFromPointerEvent

* Revert "Avoid global static in UpdateSelectionFromPointerEvent"

This reverts commit 2562d73e83b238ae0eda1c2c54247b223f539034.

* Add comment to UpdateSelectionFromPointerEvent

* Use fully mocked rendering for list box test

* Add pen selection tests

* TouchTestHelper should use correct inputs
2025-05-18 21:01:09 -07:00
Nikita Tsukanov fedbb270c0 Make sure that tests inherit from ScropedTestBase (#18690) 2025-04-23 21:39:52 +00:00
Julien Lebosquain 1583de3e33 Fix random test failures and add empty dispatcher verification to tests (#17628)
* Add VerifyEmptyDispatcherAfterTestAttribute

* Use VerifyEmptyDispatcherAfterTest and fix failing tests

* Remove unsupported timeout from sync xUnit tests
2024-11-30 04:25:31 -08:00
Steven Kirk b1489aaca2 Allow binding DataGridRow.IsSelected (#16520)
* Change namespace to prevent conflicts.

The `DataGrid` in the namespace name was hiding the `DataGrid` type.

* Initial impl of bindable DataGridRow.IsSelected.

* Make DataGridRow.IsSelected two-way bindable.
2024-08-01 06:19:38 +00:00
Max Katz 460a3549d5 Fix headless screens (#16348)
* Fix headless screens being null

* Remove unused properties
2024-07-16 18:47:43 -07:00
Max Katz 05ac6d2f1d Screens API refactor (#16295)
* Draft new API

* Push reusable ScreensBaseImpl implementation

* Fix tests and stubs

* Update ScreensPage sample to work on mobile + show new APIs

* Reimplement Windows ScreensImpl, reuse existing screens in other places of backend, use Microsoft.Windows.CsWin32 for interop

* Make X11 project buildable, don't utilize new APIs yet

* Reimplement macOS Screens API, differenciate screens by CGDirectDisplayID

* Fix build

* Adjust breaking changes file (none affect users)

* Fix missing macOS Screen.DisplayName

* Add more tests + fix screen removal

* Add screens integration tests

* Use hash set with comparer when removing screens

* Make screenimpl safer on macOS as per review

* Replace UnmanagedCallersOnly usage with source generated EnumDisplayMonitors

* Remove unused dllimport

* Only implement GetHashCode and Equals on PlatformScreen subclass, without changing base Screen
2024-07-16 15:48:18 -07:00
Benedikt Stebner 143399f65a Avalonia.Native TopLevel embedding (#15932)
* Introduce Avalonia.Native TopLevelImpl

* Update Avalonia.Native.csproj

Revert change
2024-06-19 19:55:59 -04:00
Emmanuel Hansen a17e76ee6b Use tap size as default size for scrolling start. reset IsGestureRecognitionSkipped when pointer is released (#15524)
* use tap size as default size for scrolling start. reset IsGestureRecognitionSkipped when pointer is released

* use static default constant for scroll distance

* fix typo
2024-04-29 17:33:08 -07:00
workgroupengineering 78a7f3836d feat(TabControl): Enable Recognizes AccessKey (#15013)
* feat(TabControl): Enable Recognizes AccessKey

* update sample

* test: Should_TabControl_Recognizes_AccessKey

* fix: test

* fix: using

---------

Co-authored-by: Max Katz <maxkatz6@outlook.com>
2024-04-24 18:16:48 -07:00
Max Katz 6258df5b63 Enable nullable on Avalonia.Android project (#15331)
* Enable nullable on Avalonia.Android project

* More specific exception
2024-04-11 21:03:03 -04:00
Tom Edwards e947675113 Added ToolTip.ShowOnDisabled and ToolTip.ServiceEnabled (#14928)
ToolTipService now processes raw mouse input, to allow tooltips on disabled controls
Updated tests and control catalog
2024-04-05 21:00:47 -07:00
MakesYT 299c16da55 Enhancement Allow unload AssemblyLoadContext which contains Avalonia content #13935 (#13974)
* Try fix #13935

* Fix

* Fix

* add sample

* Fix

* try load Style by reflection

* try

* Fixed an error when registering properties when uninstalling assemblies

* Allowed to delete the IAssemblyDescriptorResolver StandardAssetLoader _assemblyNameCache

* Resolving merge conflicts

* Fix

* Add exegesis

* optimize

* fix

* Resolving merge conflicts

* nuke
2024-04-05 16:28:28 -07:00
Nikita Tsukanov 4dbb165a7b Reworked the way we are clipping dirty rects with CompositionTarget (#14806)
* Reworked dirty rect tracking to support regions

* Fixed FPS counter
2024-03-05 13:37:53 -08:00
Max Katz a4086c17a6 XY focus (#13947)
* Init

* Remove XY navigation cache as it's no use

* Use pooled collection for XY navigation

* Restructure code a bit, fix IScroller handling

* Init KeyboardNavigationTests_XY tests

* Simplify XYFocus.GetNextFocusableElement usage

* Minor fixes

* Add more tests

* Remove unused NuiKeyboardNavigationHandler

* Finalizing

* Fix tests

* Add TODO12

* Make XYFocusOptions a class

* Add TestServices.FocusableWindow and make KeyboardNavigationHandler lazy, as it can't be reused on multiple windows

* Fix KeyboardNavigationHandler events handling, when focus was not actually changed

* Add arrow key tests

* Replace XYFocusKeyboardNavigationMode with more flexible XYFocusNavigationModes, integrate with KeyDeviceType input types

* Make XY focus navigation less broken, when there is no starting focused control

* Several Android TV compatibility improvements

* Remap tizen Back button to Esc

* Introduce internal XYFocusHelpers

* Make ComboBox and AutoCompleteBox handle Key events only when it's needed

* Make TextBox handle Key events only when it's needed

* Ignore Alt+Down when XY navigation is enabled in CalendarDatePicker and SplitButton

* Rename IsAllowedXYNavigationMode

* Fix ButtonSpinner with XY navigation

* Implement a very simple focus engagement for GridSplitter and Slider
2024-02-06 14:02:25 +00:00
Julien Lebosquain 7e81b5d8c2 Fix SelectedItemsControl initialization property order (#13800)
* Add SelectingItemsControl property init order tests

* Property order in SelectedItemsControl doesn't matter on init

* Fix SelectedItemsControl properties during init when Selection is set

* Fixed SelectedItemsControl.AnchorIndex after init
2023-12-22 06:54:36 +00:00
Marko Prosen f6c5720e7a Fix TimePicker empty designator on 12 hour clock (#13469)
* Test - On empty PM/AM designator on culture info the time picker should show AM/PM

* On empty PM/AM designator on culture info the time picker should show AM/PM
2023-11-12 03:13:03 +00:00
Benedikt Stebner 8da8100288 Fix SystemFontCollection nearest match lookup (#13365)
* Try to find nearest matching glyphTypeface when no exact match could by found by SystemFontCollection

* Fix glyphTypeface caching

* Rework SystemFontCollection TryCreateGlyphTypeface

* Make sure a failed glyphTypeface lookup is cached

* Make sure to only try to get nearest match if we failed to load the font via font magager impl

* Apply font simulations if possible

* Enable font simulation for embedded fonts

* Adjust simulated angle
2023-10-26 04:11:30 +00:00
Julien Lebosquain e6c1670421 Fix unit tests culture (#13016) 2023-09-25 19:50:21 +00:00
Julien Lebosquain 9548bf7337 Fix HeadlessUnitTestSession creation race condition (#12979)
* Fix HeadlessUnitTestSession creation race condition

* Bind Compositor/MediaContext to a fixed UI thread

* Fix dead lock in AvaloniaTestCase

* Rename Compositor.UIThreadDispatcher to Dispatcher
2023-09-24 00:47:31 +00:00
Emmanuel Hansen a030d29d15 add failing test 2023-08-28 12:04:10 +00:00
stepan_govorko 77dc35bf46 Introduced counting of rendered visuals in ServerCompositionVisual and added relevant unit tests in CompositorInvalidationClippingTests. The new tests ensure that visuals that are not in dirty rect are rendered correctly with different ClipToBounds and Clip geometry parameters. 2023-08-17 09:26:25 +02:00
Vladimir Kulikov 0013f44444 Setting child of TestRoot once 2023-07-07 21:57:39 +03:00
Nikita Tsukanov 8680c612fd OSX rendering refactoring 2023-06-30 15:42:12 +06:00
Giuseppe Lippolis c7b92e2026 fix: AvaloniaPublicKey.props multiple import
Warning MSB4011 "C:\GitHub\Avalonia\build\AvaloniaPublicKey.props" cannot be imported again. It was already imported at "C:\GitHub\Avalonia\Directory.Build.props (2,3)". This is most likely a build authoring error. This subsequent import will be ignored. Avalonia.Markup.Xaml.UnitTests C:\GitHub\Avalonia\tests\Avalonia.UnitTests\Avalonia.UnitTests.csproj 25
2023-06-21 18:23:28 +02:00
Emmanuel Hansen c12fe17315 Added internal helpers for protected gesture events 2023-05-31 12:51:49 +00:00
Emmanuel Hansen 5ad9e4ea4e fix tests 2023-05-31 12:27:09 +00:00
Max Katz 1183ef69d7 Merge pull request #11564 from AvaloniaUI/platform-settings
Return PlatformSettings API after being previously hidden
2023-05-31 09:55:45 +00:00
Max Katz 94e709972b Merge remote-tracking branch 'origin/master' into wpf-winforms-interop-core
# Conflicts:
#	src/Windows/Avalonia.Win32.Interop/Wpf/WpfTopLevelImpl.cs
2023-05-30 11:08:14 -04:00
Max Katz d267d06a08 Move PlatformHotkeyConfiguration to IPlatformSettings 2023-05-30 09:01:31 -04:00
Max Katz 3515143219 Use PlatformSettings from the top level internally 2023-05-29 22:06:56 -04:00
Max Katz aa78d2fc06 Merge remote-tracking branch 'origin/master' into feature/borking-changes 2023-05-29 19:39:39 -04:00