Branch:
main
0.10.0-diff-stable-0.9.11
0.8-backports
0.8-work
0.9/xamlx
5940-dragdrop-modal
7963-stable
Blaz
MikeCodesDotNET-coc-update
NumericUpDown_Fix_5318
Stylus
UnsafeAsSpan-logical-children
about-dialog-redesign
add-expanderAutomationPeer
add-integration-tests
add-missing-type-converters
add-remote-designer-test
android-profile
android_clipboard
android_naot
android_native_window_crash
android_previewer
android_text_client
animation-fill-modes-test
animations-property-path
aot-test-pipeline
api-diff-demo
appium2-vm-test
archive/wieslop-pr-to-prevent-him-from-deleting-the-repo-again-and-claiming-that-stuff-didnt-happen
attach-dev-tools-conditional
attempt-datacontext-application-class
backport-11096
backports/19939
backup/fixes/catalina-red-window-15-16-08
baget-ci-test
border-clip-test
bug/focus-within-not-cleared
bump-diagnosticssupport
castxml-0.2
chart-control
china
codefreeze-0.7
codice/preview4-plus-10064
comp-size-implicitanim-repro
compile-bindings-by-default-property
composition/license
consistent-names
context-menu-refactor
control-theme-idea
critical-time-visual
customers/chaos-11.0
customers/outsystems-11.1.X
customers/outsystems-11.1.x-without-2-prs-for-testing
customers/outsystems-11.2
customers/outsystems-branches/11.2-test-port-19132
customers/outsystems/11.2-test-port-19132
customers/se-eae
dans-repro
dans-repro-without-1284
datagrid-combobox-column
dbus-tray-icon-fix-2
debug-wasm-clicks
debug/gl-texture-mem-intercept
debug/skia-sharp-vmem
demo
demo1
designer_protocol_theme_variant
dev/timill/EglExternalObjectsFeature
dev/timill/catalyst
dev/timill/dma-buf
dev/timill/egl-take-two
dev/timill/macos-setup-app
dev/timill/metal
dev/timill/skiasharp-4-test
dev/timill/styles-animation
dev/timill/win-arm64-build
dev/timill/window-decorations-macos
dev/timill/winui-test
diagnose-ci
direct-comp-archive
disbar
dispatcher-scheduler
do-not-sign-rxui-attempt-2
doc-fixes
dont-self-register-font-manager
drawing-context-hack
droid
effective_viewport_bug_repro
emmaus/gradient_test
empty_text_run_fix
event-setter
exp/drawn-decorations-template
experiment-alpha-niner
experiment/fixing-key-events-macos-embedding
experiment/lazy-load-styles-resources
experiment/merged-fluent-theme
experiment/reflection-free
experiment/skia-known-extensions
experiment/styleinclude-filter
experiments/vulkan-interop-2025-10-29
expose-cut-copy-paste-textbox
feature-presentation-source-2
feature/17731-null-conditional-bindings
feature/2769-control-themes
feature/3109-listen
feature/ImePreeditText
feature/acrylic-brush-investigation
feature/add-get-pixels-to-IBitmapImpl
feature/backdrop-effects
feature/backdrop-experiment
feature/background-fb-transfer
feature/client-frame-in-titlebar
feature/composition-swapchain
feature/composition-tree-inspector
feature/crapium
feature/custom-visual-oob-message
feature/custom-visual-sync
feature/drawn-csd-template
feature/epoll-dispatcher-impl
feature/extract-harfbuzz
feature/flaui-webdriver
feature/fluent-calendar
feature/fluent-scrollbar
feature/fluent-slider
feature/fluent-slider-template
feature/fluent-text-box
feature/flyout-overlayinputpassthrough
feature/flyouts
feature/forced-csd
feature/fullscreen-window-state
feature/gh-actions
feature/gpu-improvements
feature/headless-touch
feature/heterogeneous-item-containers
feature/icons
feature/ilogicalvisualchildren
feature/integer-clip-bak-1
feature/integration-tests-vm-migration
feature/linux-automation
feature/linux-automation-backup
feature/managed-chrome-buttons-api
feature/media-queries
feature/microcom-get-managed-reference
feature/offthread-composition-interop
feature/opengl-image-api
feature/opengl-swapchain
feature/optimized-matrix
feature/pass-shadow-extents-to-platform
feature/pen-eraser-detection
feature/pluggable-input-methods
feature/presentation-source-2
feature/public-frost
feature/remove-legacy-renderers
feature/render-inside-windows-ui-composition-visual-tree
feature/render-thread-transparency
feature/resource-batch-update
feature/save-render-frames
feature/skia-cpu-copy
feature/staggeredlayout
feature/support-more-image-formats
feature/test-branch
feature/textbox-gestures-mac-cmd+
feature/typed-binding-2
feature/typedbinding
feature/ui-automation-atspi
feature/ui-automation-textprovider
feature/ui-automation-textprovider-2
feature/validate-draw-calls
feature/vulkan
feature/wayland-deps
feature/wayland-subcompositor
feature/wd/platform-specific-cookies-pointer-events
feature/windowstate-fullscreen
feature/wmt
feature/writablebitmap-drawingcontext
feature/x11-ime-preedit
feature/x11-incr
feature/x11-primary-selection
features/atspi-peering-mode
features/dbus+atspi2+kdeappiumdriver
features/instant-dark-light-mode-switch
features/manually-managed-layer-textures
features/modal-windows
features/net6-apple-sillicon-support
features/prep1-nullable-reference-types
fies/15433-itemscontrol-interactions-to-containers
fix-ci
fix-mac-special-character-input
fix-mousedevice-not-reporting-clicks-when-any-mouse-button-is-pressed
fix-popup-topmost-windows
fix-windowicon-crash-linuxdrm
fix/DataGridCopyClearsContent
fix/avnview-hittest
fix/ibus-committext-reset
fix/osx-ax-frame-window
fix/osx-ax-honor-ignored-elements
fix/osx-ax-offscreen-noncontrol-children
fix/osx-ax-visible-children
fix/render-stall
fix_colors_change_event_spam
fixes-data-validation-errors-use-datatemplates
fixes/11167-pagetransition-flicker
fixes/11484-coercevalue-called-multiple-times
fixes/1399-dispatchertimer-disposable
fixes/1440-menu-navigation
fixes/1758-implement-non-recycling-virtualization-mode
fixes/17699-uniformgrid-snapping
fixes/20845-tabitem-datacontext-binding-2
fixes/2129-grid-textwrapping
fixes/21746-update-target-explicit
fixes/2725-datatemplate-nested-types
fixes/2957-carousel-stackoverflow
fixes/2983-onewaytosource-twoway
fixes/4293-listbox-remove-item-selection
fixes/4496-selectionmodel-issues
fixes/6684-two-way-style-bindings-with-localvalue
fixes/7777-menu-accelerator
fixes/7925-attached-property-syntax
fixes/9007-priority-in-control-templates
fixes/971-selector-child-of-named
fixes/PreviewWithv12
fixes/add-fluent-theme-tests-and-several-fixes
fixes/android-perf-maybe
fixes/android-render-issue
fixes/appium2
fixes/automation-localization-issues
fixes/avalonia-win32-nullability
fixes/avdbus-impl2
fixes/build-stable-with-6.0.202
fixes/build-task-update-try-fix
fixes/caret-index-lost-when-selection-cleared
fixes/center-screen-maximized-parent
fixes/clear-batch-object-pool-sooner
fixes/compositing-renderer-invalidatevisual-sanity-checks
fixes/disable-fullscreen-overlay-for-border-only-mode
fixes/disable-fullscreenwindow-tests-osx
fixes/dispatcher-frame-dispatcher
fixes/dont-allow-focus-non-visible-elements
fixes/dragdrop-pointer-stuck
fixes/draw-line-on-deferred-renderer
fixes/effect-clip
fixes/effect-clip-rect
fixes/enable-multi-touch-by-default
fixes/fix-android-perf-maybe-2
fixes/gpu-interop-check-dedicated-allocation-needed
fixes/grcontext-options
fixes/hackfix-skia-gpu-interop
fixes/handle-invalid-dirty-rects
fixes/immutable-bitmap-bitmapmemory-backing
fixes/integration-tests-window-management
fixes/less-warnings
fixes/listbox-selecteditem-not-in-item-ignored
fixes/macos-dont-raise-text-input-if-key-handled
fixes/macos-duplicate-a11y-window
fixes/macos-owned-window-level-inheritance
fixes/macos-uri-handling
fixes/make-iinlinehost-public
fixes/metal-resize-jitter
fixes/microcom-bump
fixes/ncrunch-references
fixes/nsopenpanel-shortcut
fixes/osx-hidden-window-activation
fixes/osx-rendering-glitches
fixes/pendevice-remove-global-state
fixes/publish-avalonia-native-osx-package-seperately
fixes/pump-dispatcher-before-invoking-native-loop
fixes/re-enable-full-sharpgentools
fixes/readd-references-file
fixes/remove-adorner-hack
fixes/remove-loaded-virtual-method
fixes/render-layers
fixes/resizing-wasm
fixes/round-corner-clip-border
fixes/selectionmodel-handle-move
fixes/stable-disable-roll-forward
fixes/stack-overflow-resources
fixes/standalone-content-presenter
fixes/tcc-333
fixes/text-layout
fixes/textLineMetrics
fixes/ticket-745
fixes/tmp
fixes/too-many-layers
fixes/transitions-property-changes
fixes/tree-selectionmodel
fixes/treeview-nonmaterialized-selection
fixes/wasm-layout-render-sync
fixes/win-ui-comp-global-lock
fixes/win32-maximize-not-applied-initially-when-height-set
fixes/window-close-crash
fixes/window-close-crash-testcode
fixes/window-management-stage-manager
fixes/xamlx-generic-type-resolution
fixes/yet-another-dbus-typing-fix
flickerRepo
fluent-textbox-update
focus-and-keyboard
focus_prototype
focus_tree_state
font-tests
force-ci/composition-rework
force-ci/xaml-perf-improvements
foreign-embed-squash
foreign-embed-wip
foreign-embed2
git-pr_6982_rework
global-menu
gpu-optimised-deferred-rendering
grid-tests
grokys/experiment/appium-2
grokys/experiment/appium-2-2
grokys/experiment/more-benchmarks
grokys/experiment/new-itemscontrol
grokys/experiment/new-styling
grokys/framebuffer-skip-memcpy
grokys/trying-to-fix-integration-tests
grokys/update-net-5.0
gtk-solution
hack/emulate-touch-events
headless-tests
headless-timers
html-auto-port
ignore-capture-on-pointer-entered-exited
image-filters
image-scrolling-repro
implement-decorated-window-dragging
inlinesTheThird
integration-tests-selenium
ios-dev
ios-fix
issue-457
itemspresenterbase
jw/native-graphics
jw/wip/wayland
keyframe-binding
knock-knock-are-integration-tests-even-alive
layers-wtf-repro
linux-mono-down
main
managed-dialog-extras-0.9
managed-mouse-pointer
manual-fbo
maxkatz6-patch-1
memory-leak-repro-commit
menu-contexntmenu-slection-is-not-consistant
mergeWithDrawingRecording
microcom-net5-features
missing_content_repro
move
move_resize
nativeMenu-leak-fix
nativeMenuItem-leak-macOS-fix
nativeaot-llvm-experiment
ncomposition
net11-browser
new-weak-events
no-layer-hack
no-llvmpipe
no_composition_rounded
notify-test
old/2025-12-06
onformfactor_issue
open-contextmenu-with-keyboard
opentk-integration
osx-fixes
osx/maximised-set-in-xaml-fix
package-control-catalog
page_proto
parma-fixes-2020-10
pivot_touch
platform_feedback
popup-repro
port/wpf-uniformgrid
portable-xaml
pr4a/fvar-avar-parsing
pr4b/glyph-typeface-with-variation
pr4c/gvar-deformation
pr4d/hvar-advances
pr4f/mvar-metrics
pr4g/vvar-advances
pr4h/font-variations-user-api
pre-lifetime-fixes
property-path
property_transition_stops_repro
psp-repro
pull/14157
rc1-testing
refactor/avaloniapropertystore
refactor/binding-refactor-2025
refactor/binding-to-reflectionbinding
refactor/bindingexpressions-in-valuestore
refactor/bindings-are-expressions
refactor/compiledbinding-refactor-2025
refactor/datavalidation-plugins
refactor/iavaloniaobject-nongeneric
refactor/itemsrepeater-as-itemspresenter
refactor/itemsrepeater-as-itemspresenter2
refactor/layout
refactor/logical-child-optimize
refactor/more-nullable-avalonia-base
refactor/onpropertychanged-nongeneric
refactor/style-priorities
refactor/visual-child-optimize
refactor_pointerover_backportable
release/0.10.0
release/0.10.0-preview1
release/0.10.0-preview2
release/0.10.0-preview3
release/0.10.0-preview4
release/0.10.0-preview5
release/0.10.0-preview6
release/0.10.0-rc1
release/0.10.0-rc2
release/0.10.1
release/0.10.10
release/0.10.11
release/0.10.11-rc.1
release/0.10.11-rc.2
release/0.10.12
release/0.10.13
release/0.10.14
release/0.10.15
release/0.10.16
release/0.10.17
release/0.10.18
release/0.10.19
release/0.10.2
release/0.10.20
release/0.10.21
release/0.10.22
release/0.10.3
release/0.10.4
release/0.10.5
release/0.10.6
release/0.10.7
release/0.10.8
release/0.10.9
release/0.7.0
release/0.8.0
release/0.8.1
release/0.8.2
release/0.8.3
release/0.8.4
release/0.9.0
release/0.9.0-preview1
release/0.9.0-preview10
release/0.9.0-preview2
release/0.9.0-preview3
release/0.9.0-preview4
release/0.9.0-preview5
release/0.9.0-preview6
release/0.9.0-preview7
release/0.9.0-preview8
release/0.9.0-preview9
release/0.9.0-rc.1
release/0.9.0-rc.2
release/0.9.0-rc0001
release/0.9.1
release/0.9.10
release/0.9.11
release/0.9.12
release/0.9.2
release/0.9.3
release/0.9.4
release/0.9.5
release/0.9.6
release/0.9.7
release/0.9.8
release/0.9.8.1
release/0.9.9
release/11.0
release/11.0.0
release/11.0.0-preview1
release/11.0.0-preview2
release/11.0.0-preview3
release/11.0.0-preview4
release/11.0.0-preview5
release/11.0.0-preview6
release/11.0.0-preview7
release/11.0.0-preview8
release/11.0.0-rc1.1
release/11.0.0-rc2.1
release/11.0.0-rc2.2
release/11.0.1
release/11.0.10
release/11.0.11
release/11.0.12
release/11.0.13
release/11.0.2
release/11.0.3
release/11.0.4
release/11.0.5
release/11.0.5-rc1
release/11.0.6
release/11.0.7
release/11.0.8
release/11.0.9
release/11.1
release/11.1.0
release/11.1.0-beta1
release/11.1.0-beta2
release/11.1.0-rc1
release/11.1.0-rc2
release/11.1.1
release/11.1.2
release/11.1.3
release/11.1.4
release/11.1.5
release/11.2
release/11.2.0
release/11.2.0-beta1
release/11.2.0-beta2
release/11.2.0-rc1
release/11.2.0-rc2
release/11.2.1
release/11.2.2
release/11.2.3
release/11.2.4
release/11.2.5
release/11.2.6
release/11.2.7
release/11.2.8
release/11.3
release/11.3.0
release/11.3.0-beta1
release/11.3.0-beta2
release/11.3.0-rc1
release/11.3.1
release/11.3.10
release/11.3.11
release/11.3.12
release/11.3.13
release/11.3.14
release/11.3.15
release/11.3.16
release/11.3.17
release/11.3.18
release/11.3.19
release/11.3.2
release/11.3.20
release/11.3.21
release/11.3.22
release/11.3.3
release/11.3.4
release/11.3.5
release/11.3.6
release/11.3.7
release/11.3.8
release/11.3.9
release/12.0
release/12.0.0
release/12.0.0-preview1
release/12.0.0-preview2
release/12.0.0-rc1
release/12.0.0-rc2
release/12.0.1
release/12.0.2
release/12.0.3
release/12.0.4
release/12.0.5
release/12.1
release/12.1.0
release/12.1.1
release/12.1.2
release/latest
release/outsystems/0.9.11
remote-devtools
remove-acrylic-blur-from-old-win
removing-compositional-renderer-license
render-only-on-render-thread
repro-ap
repro-ap-1
repro-arcsegment-not-updating
repro-binding-window-state
repro-bindingprio-bug
repro-garbled-graphics
repro-ienumerable-menu-navigation
repro-invalid-draw-calls
repro-items-repeater-issue
repro-properties
repro-req-an-frame
repro-resource-recursion
repro-selected-items-not-working
repro-selecting-items-control-not-working-inside-popup
repro-window-close
repro/1326-data-binding-issue
repro/1436-layout-not-done-after-style-applied
repro/1707-listbox-virtualization-resize-performance
repro/1758-virtualizer-measured-items
repro/18104-drag-drop-flyout-placement
repro/20845-tabitem-datacontext-binding
repro/binding-attached-property-from-style
repro/binding-isfocused
repro/bound-listboxes
repro/caret-binding-failure
repro/carousel-not-materializing-content
repro/dynamic-resource-bug
repro/minimal-repro-stackoverflow-onewaytosource-binding
repro/outsys-sizing-issue
repro/properties-overhaul-bug
repro/radial-gradient-transform
repro/size-to-content
repro/window-not-obey-min-height
repros/content-presenter-regression
repros/custom-fonts-pr
repros/text-alignment-issue
repros/web-null-signature
revert-10284-feature/impl-IReadableBitmapImpl-in-SurfaceRenderTarget
revert-13066-fixes/13064-logical-scrollable
revert-14106
revert-18343-bump-dbus-stack
revert-2489-fixes/2432-carousel-insert
revert-2645-issue2613
revert-3221-undecorated-window
revert-selectionmodel
rtb-gl-fixes
scenegraph-after-breakage
scroll-measure
scroll_transition_repro
sdks-update
set-empty-x11-title-instead-of-null
simplify-testing
size-to-content-render-repro
skia-foreign-bitmap
sound
stable-test-mac-os-fix
stable/0.10.0
stable/0.10.x
stable/0.10.x-codice
stable/0.10.x-outsys
stable/0.10.x-se
stable/0.9
stable/outsystems-0.9
stable/parm-0.9
stable/tmp8
strongname
stx/0-preedit-reentrancy
stx/1-text-navigation
stx/10-macos-nstextinputclient
stx/11-android-inputconnection
stx/12-ios-responder
stx/13-win32-tsf
stx/2-automation-text-provider
stx/3-uia-text-pattern
stx/4-atspi-text
stx/5-grid-table-patterns
stx/6-structured-text-input
stx/7-composition-in-document
stx/9-win32-imm
styleable-grid-rowcoldefs
styles-not-getting-applied-repro
system-xaml
tabcontrol-bound-items
temp/implement-hdr
temp/rpi-slowness
temp/testbuild-skia-extensions
test-log-box-shadow
test-meta-packages
test-multiple-optimizations-together
test-package-run
test-saverestore-layer
test-styleable-rowcol-defs
test-sub-menu-item
test/suppressActivationEvents
test/trigger
test11
tests/animations-p1
tests/default-font-fail-nativeaot
testy-test
text-input
text_ime_client_direct
text_selector_adorner
text_selector_magnifier
text_selector_zindex
themes/fluent2
thread-issue-repro
timer-overload
tinywm
tmp-2
tmp-angle
tmp-build-dan
tmp-menu-disable
tmp-winuicomp_with_manual_fbo
tmp/11.0
tmp1
tmp4
tmp6
tmp9
transitions-bugfix-deux
transparency-hints-list
treeview-issue-repro
try-critical-branch-bringup-2
try-fix-3336
ui-automation-test
update-avalonia-dbus-submodule
update-submodules
upgrade-angle
use-net7-tizen
v0.8
virtualized_wrappanel
virtualizeing_wrappanel_rc1
virtualizing_grid
visual-extensions-fallback
visualbrush_recreate
vnc-mouse-drag-issue
vnext
wasm_editcontext
win-ui-comp-with-manual-fbo
win32-jitter-hack
win32_client_pos_test
win32_hidden_border_fix_test
win32_mouse_wheel_zoom
window_hide_test
windowing-prototype
windowing-prototype-drag-and-drop
winit-legacy
wip/use-selectionmodel
wip_snappoint_anchor
x11-mit-shm
x11-test-without-render-window
x11_allowed_actions
xaml_composition_animations
xaml_integrated_comp_animations
xamlil-debug-info
xclass-generator
xdatagrid-experiment
xi2-leave-event
xpf-old
xpf/composition-rework-branch
xpf/primary-mouse-device
xpf/screen-fix-21750
xpf_win32_test
xsd-generator
xy-focus-and-tvos
xy-focus-skiasharp-3
0.0.1-alpha
0.1.0-alpha2
0.1.1
0.1.10
0.1.2
0.1.3
0.1.4
0.1.9
0.10.0
0.10.0-preview1
0.10.0-preview2
0.10.0-preview3
0.10.0-preview4
0.10.0-preview5
0.10.0-preview6
0.10.0-rc1
0.10.0-rc2
0.10.0.10
0.10.0.4
0.10.1
0.10.10
0.10.11
0.10.12
0.10.12.23
0.10.13
0.10.13.24
0.10.14
0.10.15
0.10.16
0.10.17
0.10.18
0.10.19
0.10.2
0.10.20
0.10.21
0.10.22
0.10.3
0.10.4
0.10.5
0.10.6
0.10.7
0.10.8
0.10.9
0.2.0-preview
0.2.1-preview
0.3.1-preview
0.4.0
0.4.1
0.5.0
0.5.1
0.7.0
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.9.0
0.9.0-preview1
0.9.1
0.9.10
0.9.11
0.9.12
0.9.2
0.9.2.18
0.9.2.19
0.9.3
0.9.4
0.9.5
0.9.6
0.9.7
0.9.8
0.9.9
1.0.1
1.0.4
1.1.1
1.1.2
1.2.1
1.3.1
1.3.4
1.4.1
1.4.2
1.5.1
1.6.1
10367-checkpoint1
11.0.0
11.0.0-preview1
11.0.0-preview2
11.0.0-preview3
11.0.0-preview4
11.0.0-preview5
11.0.0-preview6
11.0.0-preview7
11.0.0-preview8
11.0.0-rc1.1
11.0.0-rc2.1
11.0.0-rc2.2
11.0.1
11.0.10
11.0.11
11.0.12
11.0.13
11.0.2
11.0.3
11.0.4
11.0.5
11.0.5-rc1
11.0.6
11.0.7
11.0.8
11.0.9
11.1.0
11.1.0-beta1
11.1.0-beta2
11.1.0-rc1
11.1.0-rc2
11.1.1
11.1.2
11.1.2-rc1
11.1.3
11.1.4
11.1.5
11.2.0
11.2.0-beta1
11.2.0-beta2
11.2.0-rc1
11.2.0-rc2
11.2.1
11.2.2
11.2.3
11.2.4
11.2.5
11.2.6
11.2.7
11.2.8
11.3.0
11.3.0-beta1
11.3.0-beta2
11.3.0-rc1
11.3.1
11.3.10
11.3.11
11.3.12
11.3.13
11.3.14
11.3.15
11.3.16
11.3.17
11.3.18
11.3.19
11.3.2
11.3.20
11.3.21
11.3.22
11.3.3
11.3.4
11.3.5
11.3.6
11.3.7
11.3.8
11.3.9
12.0.0
12.0.0-preview1
12.0.0-preview2
12.0.0-rc1
12.0.0-rc2
12.0.1
12.0.2
12.0.3
12.0.4
12.0.5
12.1.0
12.1.1
12.1.2
itemssource-checkpoint1
itemssource-checkpoint2
nuget-0.7.1.5
nuget-0.7.1.6
nuget-release-0.5.1
nuget-release-0.6.0
nuget-release-0.6.1
${ noResults }
28078 Commits (main)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
eb5cce2492
|
Fix CalendarDatePicker.Focus() not focusing the text box (#22170)
* Fix CalendarDatePicker.Focus() not focusing the text box OnGotFocus only forwarded focus to PART_TextBox when the navigation method was Tab, so a programmatic Focus() call left focus on the picker itself. Gate on the focus source instead, and keep select-all on Tab only. * Remove comment from CalendarDatePicker.OnGotFocus |
6 days ago |
|
|
cb3f93b685
|
Run GenerateAvaloniaResources before _InjectAvaloniaAdditionalFiles (#22175)
GenerateAvaloniaResources adds AvaloniaXaml items to AvaloniaResource, which _InjectAvaloniaAdditionalFiles then reads to build AvaloniaResourcePaths. Nothing ordered the two, so the property could be built from a partial list depending on which target MSBuild scheduled first. |
7 days ago |
|
|
082a03b7c4
|
Handle DataValidationError notifications returned by ConvertBack (#22171)
* Handle DataValidationError notifications returned by ConvertBack A converter returning a BindingNotification with DataValidationError fell through to the target type converter, which replaced it with a cast error that stringified the notification. Publish the original error instead. * Add additional failing tests. There are more `BindingNotification` cases to handle. * Handle the other `BindingNotification` cases. --------- Co-authored-by: grokys <grokys@users.noreply.github.com> |
7 days ago |
|
|
0e0e5bb81f
|
Wayland: fix scroll axis units (#22207)
Only wheels send axis_value120, so continuous sources fell through to the raw axis value, whose logical-pixel distance was read as a detent count. Convert it at 10px per detent instead, the convention GTK3, Qt, SDL and Chromium all assume, which also matches Avalonia's own X11 backend. Touchpad scrolling on Wayland becomes 10x slower as a result. |
1 week ago |
|
|
def4d7523f
|
add android and ios solution filters (#22205)
|
1 week ago |
|
|
0b713f27b6
|
Update ControlCatalog Sidebar design. (#22080)
* ControlCatalog - Side bar improvements * adjust side bar icon to adapt with side bar size * update sidebar colors * add custom title bar decorations to control catalog * share view code between home page and section page * improve side bar selection state visual * drop custom search bar in title decorations |
1 week ago |
|
|
0a7699a141
|
Fixed "TESTAPP" window sometimes appearing when Avalonia solution is open in Visual Studio (#22201)
|
1 week ago |
|
|
4fdc036368
|
macOS: Dispose COM platform object on native app termination (#22200)
|
1 week ago |
|
|
4393d521ec
|
Ignore child margins when positioning a popup (redux) (#21856)
* Added failng popup child margin test * Ignore popup child margin when positioning Avoids drop shadows and other out-of-bounds visual effects from affecting popup positioning * Fix warnings in tests * Pass Deflate to WSurface --------- Co-authored-by: Tom Edwards <tom.edwards@chaos.com> |
1 week ago |
|
|
fedb14ce85
|
Short-circuit a null-conditional operator after a cast (#22174)
Follow-up to #22082, which added the short-circuit to the property accessor nodes. The cast nodes still called ValidateNonNullSource, so a cast reported "Value is null" before the following ?. could suppress it. Casting null now produces null, as in C#, leaving any error to the member access that follows. |
1 week ago |
|
|
8057428233
|
Allow casting to a nested type in a binding path (#22173)
The binding path parser built type names with ParseIdentifier, which doesn't accept '+', so a cast like ((local:Outer+Nested)DataContext) stopped parsing at the '+' and then failed expecting a ')'. Parse type names with a variant that accepts '+'. Ordinary identifiers are unchanged. |
1 week ago |
|
|
099c373195
|
Fix issue when WindowTransparencyLevel is set to AcrylicBlur (#22144)
1. Background fully white in inactive state 2. Unusable when dark theme and white content behind window |
1 week ago |
|
|
2a34135703
|
Fix: Switching themes may crash the App (#22189)
* Unit test: Switching themes may crash the App * fix for theme switching * address copilot review * make the code cleaner and nicer |
1 week ago |
|
|
14d462439e
|
Match font family names case-insensitively (#22163)
* Tighten the comments on the synthetic caching fix Keep the invariant and the reason, drop the retelling of how the leak was found. Also plain-ASCII the dashes and correct the doc on the test counter: the alias resolution goes through the same overload, so the counter proves the cached result short-circuits the platform call too. * Match font family names case-insensitively in the glyph typeface cache Every other family-name comparison in FontCollectionBase is OrdinalIgnoreCase - the sorted family array, the binary search in TryGetGlyphTypeface, AddFontFamily's de-duplication - but the cache itself used the default ordinal comparer. Two consequences: - A request whose casing differs from the cached one misses the bucket and so skips the nearest-match branch entirely. The family-name search that picks it up afterwards returns the nearest match raw, without synthesis and without caching, so "MyAlias" at Black renders faux-bold while "MYALIAS" at Black renders regular weight. - SystemFontCollection registers a resolved face under both the platform's family name and the requested one. When those differ only in casing that stores two buckets, while AddFontFamily de-duplicates case-insensitively and publishes only the first, leaving the second unreachable from every family-name search. Also compares the requested and platform family names case-insensitively before the second registration, so the redundant add goes away rather than becoming a silent no-op. * Reuse an already cached synthetic glyph typeface TryCreateSyntheticGlyphTypeface synthesised unconditionally. When a synthetic for the same source family and key was already cached, the second one lost TryAddGlyphTypeface to the instance holding the slot, so it was handed to the caller but never cached - and GlyphTypeface has no finalizer, only an explicit Dispose reachable from the cache, so its native typeface stayed alive for the rest of the process. Each one costs a full copy of the font file, which TryGetStream reads into memory and SKTypeface.FromStream copies again. Return the cached synthetic instead when its simulations match the ones this call would apply. The source family's typefaces are already in hand for the early-out above; they were fetched and then never used. Caching under the requested family name removed the path that reached this on every call, but the method is public on IFontCollection and the race remains, so guard it at the source. * Match font family mappings case-insensitively FontManagerOptions.FontFamilyMappings is supplied by the application, so its comparer is whatever its author gave it - ordinal for a plain Dictionary<string, FontFamily>. Family names are matched case-insensitively everywhere else, so a mapping silently did not apply when the requested name differed in casing from the configured key. Copy the mappings into an OrdinalIgnoreCase dictionary in the constructor. Keys that collide only by casing were separate entries before; the last wins rather than throwing, since a mapping table is configuration and failing here would take the application down at startup. Two behaviour changes worth naming: a mapping now applies whatever casing the name arrives in, and FontManager no longer observes mutations made to the caller's dictionary after construction. |
1 week ago |
|
|
e91bad598c
|
Add TableViewColumn.IsVisible property (#22162)
* feat: Add IsVisible to TableViewColumn * test: Add TableView IsVisible tests * feat: Add option to hide a column in the ControlCatalog * chore: Remove unnecessary remark from property * docs: An other xml comment cleanup * fix: Use NaN as a sign that the width is reset and needs recalculation Also, set the ActualWidth of a hidden column to 0 * chore: Add a comment explaining what NaN means for columns ActualSize |
1 week ago |
|
|
acc1494308
|
Consolidate the Unicode segmentation trie and add UAX-29 sentence segmentation (#21875)
* Pack the segmentation properties into one Unicode trie Grapheme, indic-conjunct, word, line and sentence break classes now share a single SegmentationTrie, together with the Emoji, Emoji_Presentation and Default_Ignorable_Code_Point flags that rode in the grapheme word. The UnicodeDataTrie word keeps general category, script and script extensions. - SegmentationTrieGenerator replaces GraphemeBreakClassTrieGenerator and emits Segmentation.trie.cs; UnicodeData.trie.cs is regenerated without the break fields it no longer carries. - SentenceBreakClass data and Codepoint.SentenceBreakClass expose UAX-29 sentence classes to callers. - WordSegment carries the source text slice alongside the code-unit and code-point readouts, matching the shape newer segment types use; the existing constructor and members stay for compatibility. Data regenerated against UCD 17.0.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add UAX-29 sentence segmentation SentenceBreakEnumerator walks sentence boundaries over a UTF-16 span (rules SB1-SB11 and SB998), yielding SentenceSegment values of offset plus text slice. Sentence is the one segmentation granularity accessibility clients and IME navigation ask for that had no implementation, so callers had to approximate it with punctuation heuristics. The conformance suite runs against the Unicode SentenceBreakTest.txt data. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Make sentence segmentation linear in the text length Every rule that needed left-hand context rescanned the text backwards from the current position, so a run of spaces or closing brackets was walked once per character in it. Enumerating 40k spaces took 5.5 s; 40k closing brackets took 8.1 s, and both grew quadratically. - Fold the left-hand context into the enumerator as it advances: the last two significant classes for SB6/SB7, and a stage counter over the (STerm | ATerm) Close* Sp* (Sep | CR | LF)? grammar for SB8-SB11. - Memoize the SB8 lookahead. A scan answers every start position it passed over, so the Close* Sp* run after an ATerm is scanned once, not once per position. - Classify with bitmasks, matching LineBreakEnumerator. Both pathological inputs now finish in 0.1 ms at 40k characters. Output is unchanged: the UCD SentenceBreakTest.txt suite passes, and 1.4M random strings over the break classes segment identically to the previous implementation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Read the word segment length from the property valid for every segment WordSegment.Text is empty for segments built through the code-unit constructor that shipped in 12.1, so Text.Length holds only for segments that come from WordBreakEnumerator. Length is set by both constructors. - Measure the ellipsis break position from Length again. - Say on the Text property itself, where it is read, that it can be empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Benchmark word and sentence segmentation across text shapes The break enumerator benchmark covered three enumerators over random codepoint distributions, which measures trie lookup cost but not the per-character cost of the rules themselves. Long runs of one class are where a segmentation algorithm degrades, and nothing measured them. - Add the sentence enumerator to UnicodeBreakEnumeratorBenchmark. - Add UnicodeSegmentationScalingBenchmark: prose, Han, ZWJ emoji, and runs of spaces, closing punctuation, terminator-plus-spaces and regional indicators, each at two lengths so the cost per character is comparable between them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Document the sentence break classes and trim the break unit SentenceBreakClass is public API with nothing but the UCD aliases to go on, so a caller reading Codepoint.SentenceBreakClass has to consult UAX #29 to learn what a value means or which rule reacts to it. - Describe the type and every member in terms of what the sentence rules do with it, keeping the UCD alias as a trailing comment. - Give SentenceBreakUnit a primary constructor and drop its Codepoint property, which nothing reads now that the class is stored directly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Clean up documentation for SentenceBreakClass Removed remarks from the SentenceBreakClass documentation. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
1 week ago |
|
|
920eaa4a22
|
Carry the regional indicator parity forward instead of recounting it (#22197)
WB15 and WB16 pair regional indicators from the start of their run, and the run was recounted from that start at every indicator, so word segmentation was quadratic in the length of an unbroken run of flags. One pass over 4096 flags took 140 ms; the same text with a space between each flag took 121 us. - Track whether an odd number of regional indicators precedes the position the walk has reached, updating it as each code point is consumed. - Drop CountRegionalIndicatorsBefore, which was the only backward scan in the enumerator not bounded by the first significant code point. - Cover the pairing rules: even and odd runs, a run reached after a letter, a run split by a space, and a combining mark inside a flag. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
1 week ago |
|
|
0dbce40347
|
Add RelativeTransform to brushes (#21881)
* Apply tile brush transforms once the tile sits in target space Brush.Transform was concatenated into the shader matrix before the translation that moves the tile onto the painted area, so it acted in the tile's own space instead of the target's. A brush transform on a fill away from the origin - the common case, since a relative viewport resolves against the fill's bounds - came out displaced, and WPF, whose behaviour these brushes follow, disagrees. Both tile paths now place the tile first and let the transform act on the result. Where the placement is identity, which is what the existing goldens cover, the matrices are unchanged. The cross suite gains an image brush so the non-scalable path is covered too, plus a smooth ramp fixture: the star line drawing that was the only image asset survives resampling as sparse speckle, which the comparison metric cannot tell apart from a geometry error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Apply the conic gradient transform after its angle The sweep shader carried Angle as its local matrix and pre-concatenated Brush.Transform onto it, so the transform acted on the raw sweep and the angle then turned the result. Every other brush bakes its intrinsic geometry in first and lets the brush transform act on the finished pattern. The visible effect was that a translation moved the gradient in a direction rotated by Angle - 90 instead of the direction asked for. A sweep gradient is fully determined by its centre and angle, so the golden here is checked against the brush with its centre moved by the same offset and no transform: the two renders are pixel-identical, while the previous order is 0.169 rmse away against a 0.022 tolerance. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add RelativeTransform to every brush A brush transform expressed in the unit space of the painted bounds, applied before the absolute Transform - WPF's Brush.RelativeTransform. It lets one brush express a bounds-dependent transform, an SVG gradientTransform in objectBoundingBox units for instance, without baking any one consumer's bounds into a matrix, which is what makes a single brush per gradient definition possible. The property sits on IBrush and Brush, so every brush kind carries it and a consumer reads it without a type test. Each immutable brush takes it through a second constructor, leaving the existing signatures alone and marking them for collapse in v13. The gradient brush animator interpolates it alongside Transform, and the composition schema gains it on both brush bases so the value reaches the render thread as a live resource rather than a snapshot. IBrush is NotClientImplementable, so the added member is suppressed for API validation the way earlier additions to those interfaces are. Nothing consumes it yet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Consume RelativeTransform in the Skia backend The relative matrix is conjugated into target space at draw time - the unit square maps onto the painted rect, whose origin translation and scale wrap the matrix - and composes before the absolute brush transform. All three gradient kinds and both tile brush paths read it; a solid colour brush has nothing for it to act on, matching WPF. With no relative transform every path reduces to the previous matrices, so existing goldens stay byte-identical. The cross suite compares the result against WPF for the linear and radial gradients, a drawing brush tiled and untiled, an image brush, the composition order against Transform, one brush shared by two differently sized fills, and the solid colour no-op. Goldens under Skia/Media additionally cover the immediate renderer and the GPU backends, which the cross suite does not exercise; each was measured against its WPF counterpart before being committed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
1 week ago |
|
|
cd3b218eb4
|
Fix DateTimePickerPanel ItemHeight updates (#22158)
|
1 week ago |
|
|
888f7557bd
|
Rebuild TextBlock text runs only when the content changes (#22149)
* Keep TextBlock text runs in sync with its inlines _textRuns is built from Inlines, but OnMeasureInvalidated discarded it on any measure invalidation while Inlines still held the content. Between that point and the next measure pass, CreateTextLayout read a null _textRuns as "no inlines" and shaped Text instead, which is null whenever the content lives in Inlines. That empty result went into the TextRunCache, keyed by text source index, so every later layout reused it and the control rendered nothing until something invalidated the cache. - Discard _textRuns in InvalidateTextLayout, next to the run cache, so the runs and the cache are dropped by the same event and cannot disagree about the content. - Build the runs on demand in EnsureTextRuns, and pick the text source by HasComplexContent rather than by _textRuns being set. - Split the constraint-dependent work out of run building. Runs answer to the content alone; only an embedded control answers to the available width, so Inline.MeasureEmbeddedControls measures it and EmbeddedControlRun reports the child's DesiredSize live. Runs now survive a constraint change instead of being rebuilt every measure. SelectableTextBlock never hands the run cache to its layout, but it shared the same fallback and kept the wrong layout on _textLayout. Fixes #21902 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Invalidate the layout when LineSpacing changes LineSpacing had no case in the property change switch and is not one of the properties registered with AffectsRender, so changing it left the measured size and the rendered text untouched even though CreateTextLayout feeds it into the paragraph properties. It changes line placement rather than shaping, so it belongs with LineHeight and the other properties that keep the run cache. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Drop the text layout whenever the content is invalidated InvalidateMeasure only raises OnMeasureInvalidated while the measure is still valid, so a second content change before the next measure pass left _textLayout holding the layout the first change had already replaced. MeasureOverride keeps that layout when the constraint has not moved, so the block measured and rendered the superseded content. Clear the layout in InvalidateTextLayout and InvalidateTextLayoutKeepCache rather than relying on OnMeasureInvalidated to run, which is what TextPresenter already does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Drop the text layout when an embedded control resizes A line snapshots its metrics when it is formatted, so a layout built before a child was measured again keeps reporting the width and height that child used to have. MeasureOverride reuses the layout whenever the constraint has not moved, so a control that resizes while the block is already measure invalid never reaches the measured size. - MeasureEmbeddedControls reports whether any child came back a different size, and the layout is dropped only then rather than on every pass. - Route the remaining layout resets through DisposeTextLayout so every reset goes through one place. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
1 week ago |
|
|
c6a9d34529
|
Fix use-after-free from non-idempotent SmcCloseConnection on X11 (#22190)
X11PlatformLifetimeEvents.Dispose() could close the same session-management connection more than once. Claim the handle with Interlocked.Exchange and cancel the ICE pump before closing, so it runs exactly once. Fixes #22188 Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
1 week ago |
|
|
76005f4718
|
Remove unused internal members (#22187)
Seven internal members that nothing references. Each name occurs only once in the repository, in its own declaration. |
1 week ago |
|
|
27c1ece36c
|
Fix SplineEasing constructor assigning y2 to Y1 (#22169)
|
1 week ago |
|
|
54ae2d047f
|
Fix for ListBox ghost items - Alternative version (#22165)
* add failing test for ghost items after showing a hidden ListBox * fix ghost items * add a failing test * fix for ghost item * more tests * Fix return statement in VirtualizingStackPanel Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> |
1 week ago |
|
|
0082fc6b2a
|
Fix UIA selection never reaching the client on Windows (#22151)
* Add failing tests for SAFEARRAY marshalling of COM providers SafeArrayRef.CreateFromObjects sizes the SAFEARRAY to the pooled buffer it rents rather than to the input, and only fills a slot when the object already has a live COM wrapper. Cover both with tests driven through SafeArrayMarshaller, which is how the UIA interop actually reaches this code. Two of the three tests fail: a two-element input produces a 16-element array of nulls. The string test passes and is the control. Each provider test checks the length before it reads the entries. A wrongly sized array holds slots that were never written, and dereferencing those takes down the test host with an access violation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RYYMWsTkmkKjptFL88xjAg * Fix ISelectionProvider.GetSelection() never reaching the UIA client SafeArrayRef.CreateFromObjects had two defects, and between them every VT_UNKNOWN SAFEARRAY the automation interop produced was empty. It sized the array to the buffer it rented from ArrayPool rather than to the input, so a one-element selection became a 16-element array. The rented buffer isn't cleared, so stale pointers from an earlier rent could leak in and later be released by SafeArrayDestroy. It also filled a slot only when ComWrappers.TryGetComInstance succeeded. That call resolves a managed object that wraps a native COM instance; for a purely managed object it always fails, so no slot was ever filled and UIA received an array of nulls. Wrappers now come from ComInterfaceMarshaller<T>, which is what the rest of the interop uses. Sharing the instance matters: UI Automation identifies elements by IUnknown pointer, so a wrapper from a second ComWrappers would read as a different element. The element type isn't recoverable from the values, so SafeArrayMarshaller<T> passes it through a new generic TryCreate<T> overload. The object branch of the non-generic TryCreate is gone with it. Nothing reached it: the only other caller is ComVariant.Create, and no property value is an array of providers. This fixes ISelectionProvider.GetSelection() and, by the same route, ITableProvider.GetRowHeaders/GetColumnHeaders, ITableItemProvider, and ITextProvider.GetSelection/GetVisibleRanges. Fixes #22150 Claude-Session: https://claude.ai/code/session_01RYYMWsTkmkKjptFL88xjAg Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
1 week ago |
|
|
4ec9cbb7b8
|
Support Windows shell virtual files in drag and drop (#21907)
* Add Win32 virtual file drop support * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * docs(win32): clarify virtual file disposal * fix(win32): handle empty virtual file reads * Address virtual file data review feedback * Address virtual stream review feedback * Address final virtual stream review nits --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Julien Lebosquain <julien@lebosquain.net> |
1 week ago |
|
|
79ff4ff73e
|
[Text] Glyph Outline Part 5/13 - Shaped buffer glyph indices (#21501)
* Fix glyph metrics; expose glyph bounding box GlyphMetrics previously stored the advance in Width/Height, leaving no field for the actual ink bounding box. Correct the contract: - Expand GlyphMetrics with AdvanceWidth / AdvanceHeight (and the bitmap / vertical-layout members XOffset / YOffset / VerticalOriginX/Y, reserved for later population). - Add GlyfTable.TryGetGlyphBounds: an allocation-free, header-only read of the glyph's control-point bounding box (xMin/yMin/xMax/yMax). Empty glyphs return true with zero bounds; out-of-range / short data return false. Composite glyphs use their header bbox without recursion. - TryGetGlyphMetrics (single + batch) now sources advances into AdvanceWidth / AdvanceHeight and the bounding box into Width / Height / XBearing / YBearing via TryGetGlyphBounds. Side bearings fall back to hmtx/vmtx when the glyph has no outline. The previously latent API had one test relying on the old behaviour (Width == advance); it's updated to assert AdvanceWidth. New tests cover TryGetGlyphBounds (range, empty, letter, descriptor parity) and the corrected metrics (advance placement, ink width distinct from advance, empty-glyph advance-without-ink, batch/single parity). * Add glyph-bounds benchmark GlyphBoundsBenchmark (Avalonia.Benchmarks): a BenchmarkDotNet comparison of the table-based bounds read against Skia's SKFont.GetGlyphWidths, in kernel (font pre-created) and per-run variants across 1 / 16 / 256 glyphs, with MemoryDiagnoser. * Add allocation-free batch glyph-bounds path Adds a bounds-only batch reader so ink-bounds computation (the GlyphRunImpl use case, which already has advances from shaping) doesn't pay for advance lookup or per-glyph indirection: - GlyphBounds: internal value type carrying the control-point box. - GlyfTable.GetGlyphBounds / GlyphTypeface.TryGetGlyphBounds: fetch the glyf and loca spans once per batch and read offsets + headers directly via BinaryPrimitives — no per-glyph ReadOnlyMemory.Span conversion, no intermediate Memory.Slice, no nested call chain. LocaTable exposes RawData / IsShortFormat for this. - Batch TryGetGlyphMetrics refactored onto the same span-cached reader. Measured against Skia's SKFont.GetGlyphWidths (bounds-only, in-process BenchmarkDotNet): the table path is faster at every run length (0.06× / 0.32× / 0.66× at 1 / 16 / 256 glyphs) and allocation-free, where Skia allocates 104 B/run for the SKFont. The earlier advance+bounds path via TryGetGlyphMetrics was ~2.2× slower than Skia at 256 glyphs; the bounds-only span-cached path is ~1.5× faster. The benchmark is updated to compare bounds-only on both sides. * Restore System.Buffers.Binary using in GlyfTable The glyf bounds readers (TryGetGlyphBounds / GetGlyphBounds) read the header int16s via BinaryPrimitives. The base pr2 commit trimmed this using as unused there, but it is needed once pr2b adds the bounds code — without it GlyfTable does not compile on this branch. * Clamp glyph bounding-box extents to non-negative GlyphBounds.Width/Height and both TryGetGlyphMetrics overloads computed the ink extent as (xMax - xMin) / (yMax - yMin). A malformed glyf header where xMax < xMin (or yMax < yMin) produced a negative value that, when narrowed to the ushort GlyphMetrics.Width/Height, wrapped to a huge positive extent instead of a safe zero. Clamp the extent to non-negative in GlyphBounds (the single source of truth for both the single and batch metric paths) and route the single TryGetGlyphMetrics path through GlyphBounds so both behave identically. For int16 coordinates the maximum extent is 65535 = ushort.MaxValue, so the clamped value always fits without overflow. Adds GlyphBoundsTests. * Allocate batch glyph-metric buffers only when their source is present Batch TryGetGlyphMetrics unconditionally sized the hMetrics, vMetrics and bounds temporary buffers to glyphIds.Length, even when the font has no hmtx, no vmtx, or no glyf table. For CFF/CFF2 fonts (no glyf) the bounds buffer is never read, and most fonts have no vmtx, so a large batch on such a font heap-allocated a per-glyph array that was pure waste. Size each buffer to zero — a free, empty stackalloc — when its source table is absent, so it only materialises (and only spills to the heap past 256 glyphs) when it will actually be filled and read. * Note the halved loca offsets in the batch bounds reader The short loca format stores every offset divided by two, which is why the batch reader doubles what it reads. LocaTable's single-glyph path already carries that note; the inline decode in the batch path did not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Split the batch metrics loop on the glyf branch instead of per glyph The glyf check does not vary across the run, so it belongs above the loop rather than inside it. Splitting it also lets the bounds buffer live only in the branch that reads it, which drops the zero-length allocation that CFF / CFF2 fonts used to make just to satisfy the shared loop. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * Add vertical glyph advance API to GlyphTypeface Mirror the existing TryGetHorizontalGlyphAdvance / ...Advances pair with vertical equivalents. Until now a vertical-layout caller (CJK, Mongolian) had no advance-only path on GlyphTypeface and had to go through TryGetGlyphMetrics, which after PR2b reads the glyf bounding box per glyph — pure waste when only the advance is needed. VerticalMetricsTable already exposes the per-glyph and batch readers internally (used by TryGetGlyphMetrics(batch)); this is a thin wrapper over them. Tests cover the Latin (no vmtx → false) and CJK (vmtx → positive advances) cases and batch/single parity using Inter and MiSans-Normal. Audit note: HorizontalMetricsTable and VerticalMetricsTable batch readers already span-cache (each fetches _data.Span once per call, reusing a BigEndianBinaryReader across glyphs). No metrics-table refactor is needed — the speculative Part 2 of the plan collapses to nothing. * Expose contiguous glyph indices span on ShapedBuffer Consumers that need a ReadOnlySpan<ushort> of glyph IDs (the upcoming GlyphTypeface.TryGetGlyphBounds batch path, SKFont.GetGlyphWidths, atlas lookups...) previously had to allocate a parallel ushort[] and project GlyphInfo.GlyphIndex into it. Carry that array on the ShapedBuffer instead: - ShapedBuffer rents a parallel ushort[] from ArrayPool alongside the existing GlyphInfo[] rental, exposed as `public ReadOnlySpan<ushort> GlyphIndices`. - The indexer setter syncs both, so HarfBuzz shaping and post-shape mutators (InterWordJustification rewrites the same GlyphIndex) keep the parallel view in lockstep with no caller change. - Split / WithBidiLevel slice the indices alongside the GlyphInfos at the same offsets — both share the parent's pooled arrays. - Dispose returns both rentals. Consumer wiring: - GlyphRunImpl: copies ShapedBuffer.GlyphIndices once via CopyTo when the source is a ShapedBuffer, dropping the per-glyph extract from the position loop. - TextFormatterImpl.CreateEmptyTextLine: switched to the pooled public ctor + indexer (was passing a heap-allocated GlyphInfo[] to the internal slice ctor, which now requires a parallel ushort slice). Tests cover indexer sync, overwrite, ascending split alignment, empty-leading split, and dispose clearing the view. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
2 weeks ago |
|
|
9a876debb6
|
Fix undisposed PointerEvent JSObject on browser pointer move (#22112)
* Fix undisposed PointerEvent JSObject on browser pointer move OnPointerMove dropped argsObj (the JSObject wrapping the native DOM PointerEvent) without disposing it, except inside a Lazy factory only evaluated when GetIntermediatePoints() is called - which doesn't happen for ordinary moves/hover. Without explicit Dispose(), release requires two steps: Mono GC must collect the abandoned JSObject wrapper to release its JS handle, then V8 can reclaim the underlying JS object. Verified with a standalone FinalizationRegistry-based repro that Mono GC does not trigger on its own under continuous pointermove-like allocation pressure, so undisposed objects pile up - not a permanent leak though. Fix by disposing argsObj in a finally block after routing, guaranteeing deterministic release instead of depending on GC timing. Coalesced-event resolution (GetCoalescedEvents) is unaffected since it only runs synchronously within the same call when a consumer needs it. * Updated comments * Update src/Browser/Avalonia.Browser/BrowserInputHandler.cs Co-authored-by: Max Katz <maxkatz6@outlook.com> * Return empty list in lazy if argsObj has been disposed --------- Co-authored-by: Max Katz <maxkatz6@outlook.com> |
2 weeks ago |
|
|
5846116674
|
Cache synthetic/nearest glyph typefaces under the requested family name (#21993)
* Cache synthetic/nearest glyph typefaces under the requested family name
FontCollectionBase.TryGetGlyphTypeface only cached the resolved typeface under the
requested family name when synthesis FAILED. When TryCreateSyntheticGlyphTypeface
succeeds it registers the synthetic only under the source font's own family names,
never under the name the caller asked for.
A request arriving through a different name therefore never hits the cache and
re-enters synthesis on every call. Synthesis goes through IPlatformTypeface.TryGetStream,
which reads the entire font file into memory and hands it to SKTypeface.FromStream,
which copies it again natively - so every resolution costs one retained copy of the
whole font file.
Two common shapes reach this path:
- a platform alias, i.e. a family the font manager resolves but that is absent from
GetInstalledFontFamilyNames(). Android declares several in /system/etc/fonts.xml
(arial, helvetica, tahoma, verdana, times, courier);
- a "Family Style" composite decomposed by Typeface.Normalize (e.g. "Arial Black"
-> family arial + FontWeight.Black), which makes the requested key differ from the
key the platform returns.
Windows/DirectWrite is structurally immune: every resolvable family is also an installed
family there, so the case-insensitive family-name search finds the synthetic (registered
under its real name) on the second call and the missing entry repairs itself after one
copy. With a platform alias nothing repairs it.
Measured on Android 13 / arm64: a text widget set to "Arial Black" grew the native heap
by +1187 MB over ~14 redraws (chunks of Roboto-Regular.ttf, identified by byte
comparison), until the platform memory guard killed the process at 2.6 GB.
Adds a regression test with an IFontManagerImpl that models a platform alias: without
the fix the second resolution returns a different instance (re-synthesis), with it the
cached one.
* Make the regression test platform-independent
Back the alias with an embedded test font instead of an installed Arial, and
turn the test into a plain [Fact] so it runs on every platform.
The defect being covered lives in FontCollectionBase and is platform-agnostic,
so gating the test behind [Win32Fact] left it unexercised on the Linux and macOS
legs of CI. Relying on an installed system font also made the test dependent on
the build environment.
The fake font manager now always resolves the alias to the regular face of an
embedded font, whatever weight is asked for - which is what a platform alias
actually does - so no system font is involved at all.
* Make the regression test fail against unfixed code
Name the backing font explicitly instead of taking whichever asset
GetAssets enumerates first (currently AdobeBlank2VF.ttf, a blank
variable font), matching the style used elsewhere for embedded test
fonts.
Assert that the first resolution really is a synthesised bold. Without
it, a backing font that cannot be emboldened makes TryCreateSyntheticGlyphTypeface
fail, the old else branch caches the nearest match, and the whole test
passes against unfixed code.
Verified both ways: FontCollectionTests is 4/4 with the fix, and
Should_Cache_Synthetic_Match_Under_Requested_Family_Name is the single
failure without it.
---------
Co-authored-by: ronnycohen <19652995+ronnycohen@users.noreply.github.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
|
2 weeks ago |
|
|
b709c58c6b
|
[Text] Glyph Outline Part 2/13 - GlyphTypeface.GetGlyphOutline implementation (#21406)
* Harden cmap/name/post parsing against malformed fonts
Fonts are untrusted input, but several pre-existing table parsers throw out
of the GlyphTypeface constructor on hostile data, denying the whole font
instead of degrading the affected (cosmetic) table.
- name: wrap NameTable.Load in try/catch so a malformed table falls back to a
default family name (same outcome as an absent name), and bounds-check
NameRecord.GetValue's (offset,length) slice — the record array is validated
at load but each record's storage slice is read later during construction.
- post: wrap PostTable.Load so a malformed cosmetic-hint table degrades to
defaults rather than denying the font.
- cmap format 12/13: clamp the declared length and group count to the buffer,
computing the group span in long to avoid the nGroups*12 int overflow a
hostile count would wrap to a negative slice length.
- cmap format 4 selection: score a Windows Symbol subtable worse than any
Unicode subtable so ASCII resolves regardless of subtable order, while a
Symbol-only font still selects its only subtable.
maxp/cmap remain fatal by design. Behavioural hardening only; public API
unchanged. Backportable independently of the glyph-outline stack.
* Clamp cmap range contents and harden binary reader primitives
Format 12/13 group contents are attacker-controlled: TryGetRange used to
hand the raw uint32 end straight to per-codepoint consumers, so a group
with endCharCode 0x7FFFFFFF turned range enumeration into an unbounded
(for int.MaxValue, non-terminating) loop. Clamp ranges to the Unicode
range and map inverted/out-of-range groups to empty ranges so later
groups still enumerate.
Give the format 4 constructor the same treatment its format 12 sibling
already received: clamp the declared length and segment count to what
the buffer actually holds instead of slicing unchecked (debug asserts
replaced by the clamps).
In BigEndianBinaryReader, bounds-check array reads before allocating
(a hostile length is rejected instead of attempting the allocation),
make EnsureAvailable overflow-proof, and clamp ReadBytes against
negative counts.
* Add font parsing infrastructure for glyph outline/color drawing
Introduces shared utility types that subsequent PRs will use to
implement GetGlyphOutline (glyf table) and GetGlyphDrawing
(COLR v0/v1) on GlyphTypeface:
- ObjectPool<T>: thread-safe object pool used by Decyclers
- Decycler<T> / CycleGuard<T> / DecyclerException: generic
cycle-detection and depth-limiting utility for recursive
font-table traversal (composite glyphs, paint graphs)
- FontVariationSettings: parameter type for the upcoming
GetGlyphOutline / GetGlyphDrawing overloads
- IGlyphDrawing / GlyphDrawingType: return-type contract for color
glyph drawings (outline, color layers, SVG, bitmap)
- CharacterToGlyphMapDictionary: lightweight, allocation-free
IReadOnlyDictionary<int, ushort> view over the cmap, plus
CharacterToGlyphMap.AsReadOnlyDictionary() to expose it
No behavior change; types are not yet consumed in this PR.
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Validate ObjectPool maxSize and add unit tests
The ObjectPool<T> constructor previously accepted any maxSize value.
A value of 0 or below silently caused every Return to be discarded,
which is hard to diagnose at the call site.
- Reject maxSize < 1 with ArgumentOutOfRangeException at construction.
- Document the new precondition in the XML comment.
- Add ObjectPoolTests covering: factory null guard, maxSize bounds,
Rent/Return basics, Return ignoring null, max-size enforcement,
validator invocation and rejection, validator-as-reset, plus
concurrent stress tests for cap enforcement and parallel use.
* Validate Decycler maxDepth and add unit tests
The Decycler<T> constructor previously accepted any maxDepth value.
A value of 0 or below made the very first Enter throw
DepthLimitExceeded, which presents as a cycle/depth error at use time
instead of pointing at the construction site.
- Reject maxDepth < 1 with ArgumentOutOfRangeException at construction.
- Document the new precondition in the XML comment.
- Add DecyclerTests covering: maxDepth bounds, Enter/Exit lifecycle,
nested depth, cycle detection, depth-limit-exceeded, depth-vs-cycle
ordering, no state mutation on failed Enter, Reset semantics,
guard idempotency, MaxDepth/CurrentDepth properties, and a struct
type other than int.
* Add tests for CharacterToGlyphMap.AsReadOnlyDictionary
Covers the IReadOnlyDictionary<int, ushort> view returned by
AsReadOnlyDictionary, using the existing Inter font asset:
- ContainsKey agrees with the underlying map for both mapped and
unmapped code points.
- Indexer returns the same glyph id as map.GetGlyph for several
representative ASCII characters.
- Indexer throws KeyNotFoundException for an unmapped code point.
- TryGetValue: positive and negative paths.
- Count is positive and matches the enumerated pair count.
- Enumeration yields (key, value) pairs that round-trip through the
underlying CharacterToGlyphMap.
- Keys enumeration and pair-key enumeration agree.
- Two AsReadOnlyDictionary() calls produce functionally equivalent
views (no identity assumption).
Tests live alongside the existing CharacterToGlyphMap tests in
GlyphTypefaceTests so they can reuse the CustomPlatformTypeface
helper.
* Redesign FontVariationSettings; add GlyphDrawingOptions
FontVariationSettings is changed from a public record to a sealed class
with internal factory methods (FromCoordinates / FromInstance), a
FrozenDictionary backing for NormalizedCoordinates, and structural
Equals/GetHashCode. The type now exclusively models variable-font axis
configuration; palette and bitmap-strike concerns are moved out.
GlyphDrawingOptions is a new public sealed record that carries the
drawing options that are independent of axis configuration: an optional
CPAL palette index (≥ 0) and an optional bitmap-strike pixel size (≥ 1).
Both properties validate at init time and the type participates in
record-equality and with-expressions.
Tests are added for both types (48 new assertions).
* Make FontVariationSettings factories public
FromCoordinates and FromInstance are promoted from internal to public.
They were kept internal while the consuming public API was being designed;
that design is now settled (GlyphTypeface.CreateVariationSettings /
VariationAxes / VariationInstances, planned for PR2).
Class-level remarks are updated to describe the typeface-agnostic design
rationale and point to GlyphTypeface.CreateVariationSettings as the
preferred entry point for user-space axis values.
* Tighten contracts and docs on font-parsing infra
Polish pass on the shared infrastructure types so the contract surface is
unambiguous before PR2 (GetGlyphOutline) and PR3 (GetGlyphDrawing) build
on it:
- IGlyphDrawing now exposes GlyphDrawingType Type so callers can branch
on format without downcasting. The GlyphDrawingType enum was already
defined but unreferenced by the interface; this closes the loop.
PR3's ColorGlyphDrawing and ColorGlyphV1Drawing already implement the
property, so the rebase is a no-op.
- IGlyphDrawing.Bounds and Draw(origin) get explicit coordinate-space
docs (drawing-space, Y-down; origin is the post-flipped glyph anchor).
- Decycler<T> gets a class-level remarks block stating it is not
thread-safe (one instance per traversal) and that Enter throws on
cycle / depth-limit so callers can catch at the outermost site.
- FontVariationSettings.Default documents that null and Default are
interchangeable for parameters typed as FontVariationSettings?.
- ObjectPool.Return documents that callers must not return the same
item twice without an intervening Rent — the pool does not detect
duplicate returns by design.
Tests:
- ObjectPool: validator must not be invoked on Rent (pins the
validate-on-return contract).
- GlyphDrawingOptions: parameterless ctor equals Default (record
equality should make them interchangeable).
- FontVariationSettings: FromCoordinates with both coordinates AND
instanceIndex populated (combined form documented in the API).
83 tests pass (was 76).
* Reshape FontVariationSettings for cache-key use
Switch from a class wrapping FrozenDictionary + nullable instance index
to a readonly struct backed by a sorted ImmutableArray of a dedicated
FontVariationCoordinate record-struct. Driven by the type's role as a
field on FontCollectionKey:
- Hash code is computed once at construction and cached. Lookups in the
font-resolution cache no longer pay an OrderBy allocation per call.
- Equality is a parallel walk over two sorted arrays — no hash lookup,
no TryGetValue per element. Short-circuits on cached-hash mismatch.
- TryGetCoordinate / GetCoordinateOrDefault are linear scans, faster
than hash lookup for the typical handful-of-axes case.
- default(FontVariationSettings) is the "no variation" value. The old
Default singleton goes away; nullable-handling at the cache layer
becomes unnecessary.
- InstanceIndex is dropped from the type. Named-instance selection is
a typeface-level concern that resolves to coordinates; the runtime
settings carry coordinates only, matching CSS / HarfBuzz / DirectWrite
conventions.
Tests rewritten: 34 cases covering struct semantics, sorting,
TryGetCoordinate, hash caching, equality short-circuits, and the
FontVariationCoordinate record's own equality.
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Fix auto suggestion
* Add synthetic-font test harness
SyntheticFont / BigEndianBuffer build and mutate in-memory sfnt fonts so the
table parsers can be exercised against hand-crafted malformed input without a
platform shaper. Shared by every parser PR's malformed-font tests.
* Characterize cmap/name/post degradation on malformed input
Regression guards over the synthetic-font harness: a truncated post/name table
degrades to defaults / a fallback family name instead of denying the font, the
cmap format-12 nGroups*12 overflow is clamped, and Format-4 selection prefers a
Unicode subtable over Windows Symbol regardless of directory order.
* Fix dictionary wrapper contract, guard double-exit, and zero-coordinate canonicalization
CharacterToGlyphMapDictionary mixed two membership predicates: Keys and
Count filtered by ContainsGlyph while the indexer, TryGetValue and the
enumerator used TryGetGlyph, so glyph-0 mappings produced keys the
indexer rejected. Everything now answers through TryGetGlyph, and the
Count walk (O(codepoints) over the mapped ranges) is computed once and
cached.
Decycler.Exit decremented the depth unconditionally: CycleGuard is a
copyable ref struct, so a copied guard could exit the same id twice and
grant later traversals extra depth budget. Depth is now only returned
when the id was actually removed from the visited set.
FontVariationSettings.FromCoordinates kept zero-valued coordinates, so
an explicitly-default axis (wght=0 normalized) hashed and compared as a
distinct value from settings omitting the axis - producing duplicate
variation clones and font-collection cache entries downstream. Both
factories now canonicalize zeros away (after the duplicate-axis check,
which the dictionary overload previously skipped entirely).
* Document the cmap dictionary view and tighten Decycler/ObjectPool internals
Add XML docs to CharacterToGlyphMapDictionary's members. Collapse
Decycler.Enter's Contains-then-Add into a single HashSet.Add (a false
return means the id was already visited - a cycle). Make ObjectPool's
lock-free count fast-check a volatile read.
* Simplify FontVariationSettings.Equals to a span SequenceEqual
Map the coordinate comparison onto the inner array via the span overload
(Coordinates normalizes default to Empty, so both spans are valid). The
span SequenceEqual avoids the boxing the LINQ overload would incur on
this dictionary-key type, and FontVariationCoordinate's record-struct
value equality drives the element compare. The cached-hash early-out is
kept.
* Add pre-allocation validation in NameTable.Load so malformed name tables are rejected before creating the names array.
* Make PostTable.Load to catch only the malformed-data exception raised by this parsing path, instead of catching everything.
* Raise ArgumentOutOfRangeException for negative count
* Validate tableLength for CmapFormat12Or13Table ctor
* Fixes GlyphDrawingOptions ArgumentOutOfRangeException nameof usage
* Fix CmapFormat4Table ctor: clamp parallel-array offsets to tableLength
When a malformed subtable declares a length that drives _segCount to 0,
startCodeOffset = endCodeOffset + 0*2 + 2 (reservedPad) can exceed
tableLength, causing Slice() to throw and denying the font entirely.
Apply Math.Min(offset, tableLength) to each derived array offset so that
zero-length slices always start at a valid position, degrading silently
to an empty mapping instead of crashing.
* Revert change
* Only handle specific exceptions in NameTable.Load
Guard against negative count in BigEndianBuffer.Zeros
* Speak user space in the public variation API
Normalized coordinates are font-relative - the same value means different
user positions under different fvar ranges and avar maps - so they cannot
be authored in a style before font resolution and do not interpolate
meaningfully. Every mainstream API (CSS font-variation-settings,
DirectWrite, HarfBuzz, Skia) traffics in user-space values, and a public
normalized type named like theirs invites passing wght=700 into a [-1,1]
slot.
- new public currency: FontVariation (tag=value in designer units) and an
immutable FontVariationSettings with Parse/ToString ("wght=700,wdth=85"),
order-independent structural equality, a cached hash, and CSS last-wins
duplicate handling - usable as a style value and a cache key
- the normalized pair moves out of public view: FontVariationCoordinate
becomes internal NormalizedVariationCoordinate and the normalized
settings struct becomes internal NormalizedVariationPosition, unchanged
in behavior
- the user-space -> normalized conversion stays a per-font, application-
time concern; the fvar/avar reader lands in a follow-up PR
* Accept infinite font variation values
Infinities clamp to the axis range at apply time like any out-of-range
value, so only NaN is rejected now. Parse also uses explicit number
styles instead of NumberStyles.Float since the value text is pre-trimmed
and the whitespace flags were redundant.
* Guard NameRecord.GetValue against decoder exceptions
The selected encodings use replacement fallback and never throw on
malformed bytes, but degrade to an empty value anyway so an
exception-throwing fallback can never deny the font.
* Use nameof(value) in GlyphDrawingOptions setter exceptions
Matches the .NET runtime convention for property setters, also used
elsewhere in this repo (e.g. FormattedText).
* Add GetGlyphOutline API with glyf/loca table parsing
Implements vector outline retrieval for TrueType glyphs:
- LocaTable: parses the 'loca' table (short/long offset variants)
to map glyph IDs to glyf offsets
- GlyfTable: parses the 'glyf' table, supporting simple and
composite glyphs, and builds geometry into an IGeometryContext
- SimpleGlyph / CompositeGlyph / GlyphDescriptor / GlyphComponent /
GlyphFlag / CompositeFlags: data model for the parsed glyph
records
- GlyphDecycler: pooled cycle/depth guard for composite-glyph
recursion (derives from the shared Decycler<int>)
GlyphTypeface now eagerly loads the glyf table when a head table is
present and exposes:
Geometry? GetGlyphOutline(ushort glyphId, Matrix transform,
FontVariationSettings? variation = null)
Returns null when the font has no outline data for the glyph or the
glyph index is out of range.
* Drop variation parameter from GetGlyphOutline
The FontVariationSettings? variation parameter was a forward-compat
placeholder that was never wired through to the glyph parser. Remove it
so the API doesn't advertise capability it doesn't have.
Variable-font support will land as an instance-level concern on
GlyphTypeface itself (mirroring how FontSimulations is already baked in
at construction time), resolved through IFontCollection alongside
FontWeight/Style/Stretch. Adding variation back as a per-call parameter
would be additive at that point if a concrete need emerges.
* Add unit tests for loca/glyf parsing
Covers the glyph-outline parser that GetGlyphOutline builds on, exercised
directly against the Inter test font without a platform render interface:
- LocaTableTests: glyph-count parity with maxp, out-of-range handling,
ascending ranges for every glyph, empty-glyph (space) zero-length range.
- GlyfTableTests: TryGetGlyphData for out-of-range / empty / letter glyphs;
TryBuildGlyphGeometry into a recording IGeometryContext for simple,
empty, out-of-range and composite glyphs; transform application; closed-
figure invariants.
Tables are loaded via their internal factories and geometry is captured
through a fake IGeometryContext, so the parser logic is tested in isolation.
* Add glyph-outline render tests with Inter Variable
Render-comparison coverage for GetGlyphOutline, drawing the returned
Geometry filled in black on a white background and diffing against an
expected PNG (RMSE, 2.2% tolerance, both immediate and compositor paths):
- Should_Render_Inter_Latin_Glyph — Inter-Regular 'A' (simple glyph).
- Should_Render_Inter_Composite_Glyph — Inter-Regular 'Á' (composite
glyph: base + accent), exercises the recursive component path.
- Should_Render_MiSans_CJK_Glyph — MiSans-Normal '中' (CJK ideograph,
many contours / counters).
- Should_Render_InterVariable_At_Default — new Inter Variable asset
rendered at the default variation point. PR2 doesn't apply variation,
so this baselines the default-instance outline against which the
future variable-font work can compare deformed outputs.
- Blank_Variable_Font_Returns_Null_Outline — AdobeBlank2VF (variable
font with intentionally empty glyphs) verifies GetGlyphOutline returns
null without throwing.
Fonts are loaded via SKData.CreateCopy + SKTypeface.FromData so the
typeface's lifetime survives the source stream's disposal. This also
sidesteps a family-name collision: Inter-Regular and InterVariable both
identify as family "Inter", so FontManager resolution would be
ambiguous — direct loading targets each file unambiguously.
InterVariable.ttf is added under Assets/ and picked up by the existing
EmbeddedResource wildcard in both render-test projects.
* Set non-zero fill rule on glyph outlines
Avalonia geometries default to FillRule.EvenOdd. TrueType outlines
expect the non-zero winding rule: where same-orientation contours
overlap (an 'A' crossbar over its diagonal strokes, an accent over its
base glyph in a composite), EvenOdd XORs the regions and leaves visible
gaps. Setting the fill rule once on the outer context at the entry to
TryBuildGlyphGeometry fills the geometry correctly, including through
the composite path's TransformingGeometryContext wrapping (the
wrapping applies to transforms, not to the geometry-level fill rule).
Baselines for the three Inter glyphs were regenerated; the MiSans
ideograph is unaffected because CJK strokes don't overlap.
* Drop per-point debug logging from TransformingGeometryContext
The glyph-outline transform wrapper logged every ArcTo / BeginFigure /
CubicBezierTo / QuadraticBezierTo / LineTo / EndFigure / SetFillRule /
Dispose call through Logger.TryGet(LogEventLevel.Debug, ...). That was
useful while bringing up the glyf parser but runs a guard check per
contour point on every glyph outline build — pure overhead now that the
path is stable. Each method is back to a plain transform-and-delegate;
Dispose is a no-op (the wrapper never owned the inner context).
The exceptional-path warning in TryBuildGlyphGeometry (cyclic composite
glyphs) is unrelated and stays.
* Add InterVariable.ttf to Should_AddGlyphTypeface_By_Stream font list
The glyph-outline render tests embed InterVariable.ttf under
Avalonia.RenderTests/Assets, which the Skia unit-test project picks up
via its `EmbeddedResource Include="..\Avalonia.RenderTests\Assets\**\*.ttf"`
glob. The asset enumeration therefore returns 16 fonts while the test's
hard-coded `infos` list had 15, failing the count assertion.
Add the missing entry in its ordinal-case-insensitive sort position
(after Inter-Regular.ttf). Its production identity — FamilyName
"Inter Variable", Weight Normal (the default fvar instance, usWeightClass
400) — is distinct from the "Inter" family of Inter-Regular/Inter-Bold,
so the (family, weight) round-trip lookup stays unique.
* Fix off-by-one glyph-id bounds check; drop unused usings
GetGlyphOutline rejected out-of-range ids with `glyphId > GlyphCount`,
which let the id equal to GlyphCount slip through — valid glyph ids are
0..GlyphCount-1, and reading at index GlyphCount walks past the end of
the loca offsets. Use `>=` so the upper bound is excluded.
Also remove unused using directives from the glyf parsers
(CompositeGlyph, GlyfTable, GlyphDescriptor, SimpleGlyph).
* Allocate batch glyph-metric buffers only when their source is present
Batch TryGetGlyphMetrics unconditionally sized the hMetrics and vMetrics
temporary buffers to glyphIds.Length even when the font has no hmtx or no
vmtx. Most fonts ship no vmtx, so a large batch heap-allocated a per-glyph
vertical-metric array that was never read.
Size each buffer to zero — a free, empty stackalloc — when its source
table is absent, so it only materialises (and only spills to the heap
past 256 glyphs) when it will actually be filled and read.
* Bail out of composite glyphs that use point matching
A composite component with ARGS_ARE_XY_VALUES clear positions itself by
point matching: arg1/arg2 are point indices, and the component is placed
so one of its points coincides with a point in the already-assembled
parent glyph. CreateComponentTransform only applied a translation when
ARGS_ARE_XY_VALUES was set, so a point-matched component was rendered at
zero translation — a visibly wrong outline.
Point matching isn't implemented. Rather than emit an incorrect glyph,
return false for any composite that uses it (checked before any geometry
is emitted) so the caller falls back to "no outline". XY-value composites
(the overwhelming common case, e.g. accented Latin letters) are
unaffected.
* Support composite glyph point matching
Composite components with ARGS_ARE_XY_VALUES clear are positioned by aligning one of their points onto a point of the already-assembled glyph rather than by an x/y offset. The streaming build path cannot retain points, so route these (rare) composites through a new materialising path: resolve every component into a pooled buffer, apply the point-match translation, then emit the assembled contours.
Out-of-range point indices, phantom-point references, and nested composite components bail out (no outline) rather than render incorrectly. Replaces the previous bail-out, and adds a synthetic-font test covering matched-point alignment and the bail-out cases.
* Add point-matching composite render test
No production font encodes composite point matching (ARGS_ARE_XY_VALUES clear) — verified across the Inter, Noto, Source, SIL (Gentium/Charis/Andika) and Oswald families, which all use x/y offsets. To exercise GlyfTable's point-matching path through the full Skia pipeline, this adds a small purpose-built fixture (PointMatch.ttf, 880 bytes) whose 'P' glyph is a composite: a base rectangle plus a square placed by point matching, aligning the square's bottom-left point onto the rectangle's top-right point.
The baseline shows the square fused to the rectangle's top-right corner; a regression that mishandled point matching would drop it at the origin, which the image diff catches.
* Add missing test font to the list of expected fonts in the Should_AddGlyphTypeface_By_Stream test
* Return an immutable IGeometryImpl from GetGlyphOutline
GetGlyphOutline(ushort, Matrix) returned a mutable StreamGeometry (an AvaloniaObject) with the transform baked in — neither cacheable (every pen position is a distinct geometry) nor safe to share. Reshape to GetGlyphOutline(ushort) returning design-unit-space geometry as an immutable IGeometryImpl (a small sealed wrapper that exposes only the read-only surface and can't be re-opened), so a single instance is safe to cache and share on the future glyph-run hot path. Callers apply scale/position via IGeometryImpl.WithTransform or a drawing-context transform, and draw through the existing DrawGeometry(IGeometryImpl) overload.
* Add SyntheticFont harness self-tests
Round-trip, table patch/replace/remove/truncate, and asset-load tests for the
synthetic-font harness over Inter-Regular and InterVariable.
* Reject non-monotonic contour endpoints in simple glyph parsing
numPoints is derived from the last contour endpoint alone, so a glyph
whose endPtsOfContours array is not strictly increasing sized its point
buffers too small and sent every consumer walk indexing past them - an
IndexOutOfRangeException on each outline build of that glyph. Validate
the endpoints up front and return the default (empty) glyph instead.
* Rename glyph-index parameters to glyphIndex / glyphIndices
Review feedback on the glyph-outline API: the ushort values these members
take are glyph indices, and the platform already speaks that language
(GlyphRun.GlyphIndices), so the parameters say what they are instead of
the looser glyphId/glyphIds. Applies to GetGlyphOutline and the
advance/metrics members this series reworks, plus the tests exercising
them. Purely a naming change - no call site uses named arguments.
* Add failing tests for the off-curve contour walk
The off-curve-start branch of the glyph walker drops one quadratic per
extra point in runs of consecutive off-curve points and ignores an
on-curve last point when picking the figure start. Pins the correct
TrueType decomposition; the on-curve-start case is pinned as-is.
* Unify the contour walkers into one EmitContour
Both geometry emitters carried the same on-curve/off-curve branch pair,
and the off-curve branch had two defects: it advanced past both points
of an off-curve pair (dropping one quadratic per extra point in longer
off-curve runs) and always started at the implied midpoint even when
the last point of the contour is on-curve. One shared walker now does
the TrueType decomposition with a pending-control state machine and an
explicit close, and both the simple-glyph path and the point-matching
composite path route every contour through it.
* Add failing tests for truncated glyf and loca data
The counts in a simple glyph header and in maxp are untrusted: a body
shorter than they promise currently throws out of SimpleGlyph.Create,
and a short loca table reports a glyph count it cannot index.
* Degrade to an empty outline on truncated glyf/loca data
SimpleGlyph.Create bounds-checks the endpoint array, the declared
instruction run and every flag/coordinate read, returning default (and
the rented buffers) instead of throwing when the body is shorter than
its untrusted counts promise. LocaTable clamps its glyph count to the
entries the table data actually covers, replacing an empty validation
block that only claimed to handle short tables.
* Name bit 6 of the simple glyph flags OVERLAP_SIMPLE
The OpenType spec assigns bit 6 (0x40) OVERLAP_SIMPLE; only bit 7 is
reserved.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
|
2 weeks ago |
|
|
d467b61610
|
Fix X11 LeaveWindow not raised with software rendering (#22120)
|
2 weeks ago |
|
|
486058fc98
|
Send a synthetic UnmapNotify when hiding an X11 window (#22135)
ICCCM 4.1.4 requires a client withdrawing a top-level window to also send a synthetic UnmapNotify to the root window. XUnmapWindow alone generates no event when the window manager has already unmapped the window, leaving a minimized window listed as managed and iconic after Hide(). Co-authored-by: liuclare <177657698+liuclare@users.noreply.github.com> |
2 weeks ago |
|
|
f2e8e8931f
|
Add generic navigation apis to Page Navigation (#22010)
* add page navigation using generic type * add tests * add default impl to INavigation api * fix nullable errors * update api diff * addressed comment * update api * move page externsion to own class * make parameter overload non-optional |
2 weeks ago |
|
|
380bd8a2f4
|
Fix macOS accent color not respecting the current theme (#22143)
|
2 weeks ago |
|
|
c0183eaa88
|
Fix fatal NRE when the Win32 input pane is disposed during window close (#22138)
* Fix fatal NRE when the Win32 input pane is disposed during window close WindowsInputPane.Dispose set _windowImpl to null before calling IFrameworkInputPane.Unadvise. Unadvise can deliver a final Showing/Hiding notification as it unwinds, and the shell may also call back after teardown. Either path reaches OnStateChanged -> ScreenRectToClient, which dereferences the now-null _windowImpl. Because that frame is entered from native code through a COM callback, the resulting NullReferenceException cannot unwind into managed code: the process is terminated with 0xC0000005 instead of raising a catchable exception. Two changes, both minimal: - Release _windowImpl only after Unadvise has returned, so the field stays valid for the whole of the teardown during which it is read. - Return early from OnStateChanged once _disposed is set, so a notification arriving during or after Dispose is ignored rather than acted on. Either change alone closes the reported race; together they also cover a callback that arrives after Dispose has completed. * Rewrite input pane comment to be more concise --------- Co-authored-by: Max Katz <maxkatz6@outlook.com> |
2 weeks ago |
|
|
39f6e55b2e
|
Fix AssemblyDescriptorResolver.GetAssembly(string name) to not throw CultureNotFoundException (#22137)
* Fix AssemblyDescriptorResolver GetAssembly 21517 Fix Avalonia.Platform.Internal.AssemblyDescriptorResolver.GetAssembly(string name) to not throw CultureNotFoundException when <InvariantGlobalization>true</InvariantGlobalization> and <PublishAot>true</PublishAot> . * Fix handling multiple names with the same prefix * Add explanation comment |
2 weeks ago |
|
|
9d5c2fa81d
|
Fix empty FlexPanel size (#22130)
|
2 weeks ago |
|
|
4ace5b782e
|
Fix the avalonia scale in x11 (#22129)
|
2 weeks ago |
|
|
76ff633d7c
|
Fix hidden Win32 TrayIcon appearing after icon updates Preserve the current tray icon registration state when updating its icon, so a hidden TrayIcon remains hidden until SetIsVisible(true) is called. (#22125)
|
2 weeks ago |
|
|
774f561a91
|
Android: fix crash on a stale accessibility virtual view id (#22122)
* Android: never leave an accessibility node without text or content description
`ExploreByTouchHelper.createNodeForChild` validates every virtual view the
callback produces and throws
Callbacks must add text or a content description in populateNodeForVirtualViewId()
when the node carries neither. It throws from inside an accessibility callback,
so the exception is not recoverable by the application: the process goes down.
`TextUtils.isEmpty` treats `""` as empty, so an empty string does not satisfy
the contract - only a non-empty value does. Two paths in
`OnPopulateNodeForVirtualView` could produce such a node:
* **A live peer with no accessible name.** `nodeInfo.Text ??= peer.GetName()`
looks like it only assigns when nothing was set, but `AutomationPeer.GetName()`
and `GetHelpText()` never return null - they collapse a missing value to
`string.Empty` - so both assignments always run and can both assign `""`.
This happens for any peer that is a pure container: a `Panel`, a `Border`, or
the `TextSelectorLayer` that is added when a text selection starts. On a device
with an accessibility service running, the first touch on a text field was
enough to bring the application down.
* **A stale virtual view id.** Since #22024 peers are unregistered when their
control leaves the visual tree, and the platform can still ask for a node it
obtained earlier - it caches them, and it re-queries the accessibility focused
one. The lookup then fails and the node was left untouched, which the same
validation rejects.
Both are fixed by guaranteeing a non-empty content description. A single space
is used deliberately: it satisfies the platform contract without inventing a
label that screen readers would announce.
Note that `AutomationPeer.GetClassName()` has the same `?? string.Empty` shape,
so it cannot serve as the fallback.
### Testing
`Avalonia.Android` builds clean. The crash paths need a device with an
accessibility service enabled and are not reachable from the unit test projects;
the fix was verified on hardware (Android 13 kiosk) where the first touch on a
text field used to take the application down on every armed process.
* Android: default an unlabelled node to its type name, and correct the attribution
Review feedback: a single space only satisfies the platform contract, it does not
describe anything, and it hides an unnamed control instead of surfacing it. The
fallback is available - GetClassNameCore() is abstract and ControlAutomationPeer
returns Owner.GetType().Name - so a peer always has a type name, which is also what
nodeInfo.ClassName already carries.
This also corrects a claim made in the first revision of this change. The androidx
guard does not use TextUtils.isEmpty: in androidx.customview 1.1.0 and 1.2.0,
createNodeForChild tests getText() and getContentDescription() for null, strictly,
and the class contains no TextUtils reference at all (the isEmpty guard sits on the
event path, which throws populateEventForVirtualViewId()).
Since AutomationPeer.GetName() collapses a missing name to string.Empty, a node
built for an unnamed container was therefore never rejected. Only the stale virtual
view id path - reachable since #22024 unregisters peers on detach - produced a node
the platform refuses. The placeholder there is now string.Empty, and the type name
default is presented for what it is: an accessibility improvement, not a crash fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Cut the explanatory comments down, per review on #22123
The rationale belongs in the pull request, not in the source. Only the two lines a
reader cannot infer from the code are kept.
* Drop the type name default, as requested in review
Keeps this PR to the crash fix alone. The default label for an unnamed node is a
separate discussion.
---------
Co-authored-by: ronnycohen <19652995+ronnycohen@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
2 weeks ago |
|
|
59affb9702
|
fix(macos): prevent title bar flash on fullscreen exit (#22101)
- Restore title bar transparency before AppKit begins the exit animation for windows with an extended client area. |
2 weeks ago |
|
|
bf44e6ab98
|
[osx] Use NSTrackingInVisibleRect for mouse movement tracking (#21996)
* [osx] Use NSTrackingInVisibleRect for tracking mouse movement * nit: comment * Update native/Avalonia.Native/src/OSX/AvnView.mm Co-authored-by: Max Katz <maxkatz6@outlook.com> --------- Co-authored-by: Max Katz <maxkatz6@outlook.com> |
2 weeks ago |
|
|
5d25bd6463
|
Fix init order of SetupWithClassicDesktopLifetime (#21954)
* Fix init order of SetupWithClassicDesktopLifetime * Don't raise Startup in Setup * Fix warning |
2 weeks ago |
|
|
72218879d8
|
Fix focus being locked when restoring focus to a control thats detached from visual tree. (#22113)
* add failing test for detached focus * Clear focus if restore element is not in focus scope * check for focus eligibility when restoring focus * add failing test for second focus scope stealing focus * if focus scope is not the current focus scope, don't attempt to set focus |
2 weeks ago |
|
|
0820644223
|
Android: never walk an InteropAutomationPeer during accessibility traversal (#22123)
* Android: never walk an InteropAutomationPeer during accessibility traversal
InteropAutomationPeer - the peer of a native interop control - throws
NotImplementedException from almost every member (GetOrCreateChildrenCore,
GetNameCore, GetBoundingRectangleCore, IsEnabledCore...), because it is meant to
be special-cased by each platform backend. macOS does so through
AvnAutomationPeer.IsInteropPeer, Windows through AutomationNode.InteropAutomationNode.
Android did not, and AvaloniaAccessHelper called those members without any guard.
Any accessibility traversal reaching a screen that hosts a native control - a
NativeControlHost, so a WebView or an embedded media surface - therefore threw from
inside an accessibility callback, which is not recoverable: the process goes down.
It is reproducible in one command on such a screen:
adb shell uiautomator dump
Reported by any accessibility client walking the tree, so a screen reader or an MDM
agent would take the same path.
Interop peers are now filtered at every point where a virtual view ID could be
handed out: the point hit test, the visible-views enumeration, the focused peer, and
the children walk. A virtual view ID is therefore never allocated for one, and
OnPopulateNodeForVirtualView never has to deal with one - which matters, because it
may not answer with an unpopulated node: ExploreByTouchHelper.createNodeForChild
rejects that and throws too.
Skipping is the correct behaviour here rather than merely the safe one: a native
control is a real Android View, already exposed to the accessibility framework on
its own. Presenting it a second time as an Avalonia virtual view would duplicate it.
InteropAutomationPeer is internal, hence the InternalsVisibleTo entry - Avalonia.Native
and Avalonia.Win32.Automation already have one for the same reason.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Drop the explanatory comments, per review
The rationale belongs in the pull request, not in the source.
---------
Co-authored-by: ronnycohen <19652995+ronnycohen@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
2 weeks ago |
|
|
2e7d2c5c60
|
Fix infinite loop when a text run shapes to no glyphs (#22119)
* Add failing tests for runs that shape to no glyphs A shaper hides the default ignorables it substitutes for line breaks behind the font's space glyph, and deletes them when the font has no such glyph. A run holding nothing but a line break then shapes to an empty glyph buffer while still owning its characters. - TextFormatter drops that run today, so the line covers no text and the layout loop never advances past it - measuring a wrapping TextBlock whose text starts with a newline never returns. - GlyphRun indexes its glyph list without checking it is non-empty, so hit-testing such a run throws IndexOutOfRangeException. Covers all three layers: GlyphRun hit-testing, the formatted line, and the TextLayout repro from the issue. The layout test bounds maxLines so a regression fails instead of hanging the test run. The Skia tests embed the headless platform's BareMinimum.ttf, which has four glyphs and no space, rather than a copy of it. * Keep text runs that shape to no glyphs ShapeTogether split the shaped buffer by glyph count, so a run whose glyphs were all deleted by the shaper was skipped and its characters rolled into previousLength for a following run to absorb. When no such run follows, the characters are lost: the line reports a length of 0 and TextLayout formats the same line forever. Splitting by text length preserves the case the accumulation exists for - a run whose glyphs merged into a neighbouring cluster splits off no text either - and stops discarding characters that shaped to nothing. That makes zero-glyph glyph runs reachable for the first time, so: - GetDistanceFromCharacterHit, FindGlyphIndex and FindNearestCharacterHit handle an empty glyph list. There is no cluster to snap to and the run sits at a single position, so it degenerates to one zero-width cluster. - InkBounds answers empty directly instead of building a platform glyph run. TextLineImpl reads it for every shaped run in a line, and the Skia implementation creates an SKFont and measures glyph widths in its constructor - wasted on a run that marks nothing. Fixes #22004 * Adjust GlyphRun.InkBounds xml comment |
2 weeks ago |
|
|
1c9e559996
|
Fix #7536: crash when changing source during SelectionChanged (#22102)
* Add failing test for #7536 Reproduces the "Cannot change source while update is in progress" crash that occurs when a SelectingItemsControl's ItemsSource is changed from within its own SelectionChanged handler while the selection is being lost. When selection is lost, CommitOperation bumps the operation UpdateCount before raising LostSelection but never decrements it, so SelectionChanged is raised with UpdateCount > 0 and SetSource throws. Claude-Session: https://claude.ai/code/session_01FXP1ejZ9VhUwecY9QCRKVb Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Fix #7536: crash when changing source during SelectionChanged When the selection was lost, SelectionModel.CommitOperation incremented the operation's UpdateCount before raising LostSelection but never decremented it. As a result the rest of the commit - including the SelectionChanged event - ran with UpdateCount > 0, so a handler that changed the control's source (as StructuredLogViewer's UpdateBreadcrumb does) hit the "Cannot change source while update is in progress." guard in SetSource and threw. Decrement UpdateCount again once the LostSelection handler has returned so that the batching only covers the handler itself and the SelectionChanged event is free to change the source. Claude-Session: https://claude.ai/code/session_01FXP1ejZ9VhUwecY9QCRKVb Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Add test for changing selection from SelectionChanged when AlwaysSelected reselects Covers the interaction between the #7536 fix and AlwaysSelected: clearing the selection makes AlwaysSelected reselect the first item via LostSelection (which must still fold into the current operation), and a SelectionChanged handler that then changes the selection must be honoured rather than swallowed by the batch update wrapping the LostSelection handler. Fails before the fix (selection stays on the reselected item), passes after. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FXP1ejZ9VhUwecY9QCRKVb * Assert that `SelectionChanged` was called. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
2 weeks ago |
|
|
9654332a79
|
Fix Vulkan image layout in GPU interop (#21787)
* Pass initial image layout to Vulkan image import * Add enum for external image layouts * Move external image layout into a Vulkan-specific properties struct Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtkFtYVzECdMvQa9ABrD9P --------- Co-authored-by: Nikita Tsukanov <keks9n@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
2 weeks ago |
|
|
24641c9db9
|
Support `TextInputOptions.IsSensitive` and ContentType Pin on Android (#22110)
- Fixes #22108 |
2 weeks ago |
|
|
9254686fea
|
X11: Implement XShm support (#21625)
* Begin define some of the type to X11 XShm https://github.com/AvaloniaUI/Avalonia/discussions/16690 * Add libc define * Try fix comment. * Copy XShm define code * Update the comment in XShm.cs * Try define the IFramebufferRenderTarget but fail. * Add the XShmCompletionEvent * Try to get the XShmCompletionEvent without DeferredDisplayEvents * Try open the softrender mode tode debug the FramebufferRenderTarget * Receive the completion for xshm * Check the xshm support before add * Pass the visual and depth argument * Remove X11ShmImageManager from X11ShmFramebufferContext * Finish create X11ShmImage. * Fix lost ShmSeg * Remove the presentationQueue in X11ShmImageManager * Add the PresentationCount * If the depth is not 32, we should do some conversion to make the XShmPutImage work. But the conversion is slowly, so we should not use XShmPutImage when the depth is not 32 * Finish send render * Finish dispose the xshm image * Move types into matching files * Revert "Try open the softrender mode tode debug the FramebufferRenderTarget" This reverts commit |
2 weeks ago |