* Don't tick with render loop when app is idle
* Update src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* wip
* wip
* api diff
* fixes
* Address review: clear wakeupPending at tick start, guard CarbonEmissionsHack subscriptions
- Clear _wakeupPending at start of TimerTick so wakeups already processed
by the current tick don't force an unnecessary extra tick
- Guard CarbonEmissionsHack against duplicate subscriptions using a private
attached property
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix lock-order inversion in Add/Remove vs TimerTick
Move Wakeup() and Stop() calls outside the _items lock in Add/Remove
to prevent deadlock with TimerTick which acquires _timerLock then _items.
Add/Remove are UI-thread-only so the extracted logic remains safe.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: remove unused usings, guard double Stop(), fix SleepLoop extra frame
- Remove unused using directives from IRenderLoopTask.cs
- Guard TimerTick Stop() with _running check to prevent double Stop()
when Remove() already stopped the timer
- SleepLoopRenderTimer: use WaitOne(timeout) instead of Thread.Sleep
so Stop() can interrupt the sleep, and recheck _stopped before Tick
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix DisplayLinkTimer foreground handler bypassing render loop state
Only resume the display link on WillEnterForeground if the timer was
calling Start() to avoid setting _stopped=false when the render loop
had the timer stopped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix DisplayLinkTimer thread safety, revert global NU5104 suppression
- Stop() now only sets _stopped flag; OnLinkTick() self-pauses the
CADisplayLink from the timer thread to avoid thread-affinity issues
- Revert NU5104 global suppression in SharedVersion.props
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Cap _ticksSinceLastCommit to prevent int overflow
Stop incrementing once it reaches CommitGraceTicks to prevent
wrapping negative and keeping the render loop awake indefinitely.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* refactor: remove Start/Stop from IRenderTimer, merge into Tick setter
Timer start/stop is now controlled entirely by setting the Tick
property: non-null starts, null stops. This eliminates the explicit
Start()/Stop() methods from IRenderTimer, making the API simpler.
DefaultRenderLoop controls the timer purely through Tick assignment
under its _timerLock. A new _hasItems flag tracks subscriber presence
since Tick is now transient (null when idle).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: address review comments on timer thread safety and guards
- ChoreographerTimer: add _frameCallbackActive guard to prevent double
PostFrameCallback from both Tick setter and SubscribeView
- ServerCompositor: cap _ticksSinceLastCommit at int.MaxValue
- SleepLoopRenderTimer: make _tick volatile, remove _stopped recheck
(guard moved to DefaultRenderLoop)
- DefaultRenderLoop: add _running check at tick start to drop late ticks
- ThreadProxyRenderTimer: add lock for internal state manipulation
- DisplayLinkTimer: add lock for all internal state manipulation
- Re-add NU5104 suppression to SharedVersion.props
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: make _hasItems volatile for cross-thread visibility
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix: guard against redundant starts in DefaultRenderTimer, make _tick volatile across all timers
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Remove CarbonEmissionsHack, revert iOS/Android timers to always-ticking
- Delete CarbonEmissionsHack class and its XAML reference
- Revert DisplayLinkTimer (iOS) to original always-ticking implementation
- Revert ChoreographerTimer (Android) to original always-ticking implementation
- Add TODO comments for future start/stop on RenderLoop request
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix DirectCompositionConnection WaitOne not respecting process exit cancellation
Use WaitHandle.WaitAny with both _wakeEvent and cts.Token.WaitHandle so
the loop can exit when ProcessExit fires while the timer is stopped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* timers
* XML docs
* Cache delegate
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Implemented new drawn window decorations API
TODO: check if it works on Win32, bring back titlebar automation peer
* Adjusting naming a bit
* Naming / configuration changes
* Various fixes
* popover fix?
* wip
* Address review
* Extra window roles
* WIP
* Fixed drawn titlebar automation
* Purge ExtendClientAreaChromeHints.
* Fixed dynamically enabling drawn decorations
* api diff
* Add automation IDs for drawn decorations buttons
* Resolved the issues
* build
* Retry a few times when Pager isn't available after test is finished
* Only do faulty test detection if asked
* duplicate package reference
* Try disabling faulty tests on appium1
* Fix ExtendClientAreaWindowTests
* Apply initial button states
* Enable CSD shadow for X11
* net8?
* Address review
* more review comments
* Moar review comments
* Extra hit-test checks
* Moar review
* Prefix integration test app exitfullscreen to avoid clashes
* Disable drawn decorations if parts = None
* Respect SystemDecorations value on mac in extend-client-area mode
* Tidy up logic a bit
* Adjust win32 tests to titlebar not being in the tree when CSD are not enabled
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* move gesture events from Gestures to InputElement. Fix holding gesture interactions with context menu
* update api diff
* address review comments
* fix some test types
* rename Cancelled to Canceled
* update api diff
* Make MathUtilities internal
* Remove old overloads from LayoutHelper
* Make DrawingContextHelper.WrapSkiaCanvas internal
* Update API suppressions
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Onboard onto Central Package Management
* Remove SharpDX
* Add back <clear /> to NuGet.config package source mapping
* Package mapping
* Inline props where appropriate
* Lost a space
* Extracted IInputRoot out of TopLevel
* Move some input handling out of TopLevel
* Remove old class, make layout manager private
* Removed IRenderRoot
* Make VisualTreeAttachmentEventArgs a bit more sensible
* Move ILayoutRoot to PresentationSource
# Conflicts:
# tests/Avalonia.Controls.UnitTests/TabControlTests.cs
* Updated some VisualRoot / GetVisualRoot usages
* Updated more XxxRoot usages
* More Root usages
* Addressed review
* Hurr-durr xml
* More fixes
* Maybe fix android compilation
* API diff
* Yet another cast
* I had to use MSIL analysis to detect those casts
* Fixed automation
* Fix PointerOverPreProcessor
* Fix?
* Removed yet another cast to Visual
* The amount of random downcasts is astonishing
* Maybe fix mac
* Addressed review
* Native DockMenu code
* Add Native Interop
* Update ControlCatalog sample
* Add unit tests
* Add Action<IAvnMenu> to AvaloniaNativeMenuExporter
* Add dynamic dock item demo
* Move s_dockMenu reference to App
* Use Appium tests
* Revert INativeMenuExporterResetHandler
* Properly set the button for the checkbox
* Add dock test
* I hate Appium
* Rename NativeMenu.DockMenu to NativeDock.Menu
* Make static
* Remove Dock Click Test
* Add white space back for cleaner diff
* Reduce MenuExporter back to one
* Revert UpdateIfNeeded to private
* Revert QueueReset to private too... and fix some whitespace
* Revert IAvnMenuItem/IAvnMenu back
* That's what I get not comparing it to master
* And update this too
* Add documentation
* Implement -accessibilityPlaceholderValue on macOS
macOS uses a unique -accessibilityPlaceholderValue property for the
placeholder of a text field; -accessibilityHelp has different meaning from
HelpText on Windows. Map TextBox.PlaceholderText to be returned by
-accessibilityPlaceholderValue.
Ref: https://www.w3.org/TR/core-aam-1.2/#ariaPlaceholder
* Use TextBox placeholder as a fallback for HelpText on Windows
This matches the behavior introduced in 8593ef3 on macOS, as this is where
UIA designates that placeholder text should go.
Ref: https://www.w3.org/TR/core-aam-1.2/#ariaPlaceholder
* On Frame-Buffer-Orientation: Add screen orientation support for Linux frame buffer and DRM applications.
This commit introduces support for screen orientation across various components by adding a new `Orientation` property of type `SurfaceOrientation` in `DrmOutputOptions` and `FbDevOutputOptions`. The `IScreenInfoProvider` interface is updated to inherit from `ISurfaceOrientation`, ensuring consistent orientation management.
Key changes include:
- Enhanced `FramebufferToplevelImpl` to handle orientation in size calculations.
- Updated `LibInputBackend` for device input coordinate rotation based on screen orientation.
- Implemented `ISurfaceOrientation` in `DrmOutput` and `FbdevOutput` classes.
- Modified `DrawingContextImpl` to support canvas rotation based on orientation.
- Improved `FramebufferRenderTarget` and `PixelFormatConversionShim` to respect framebuffer orientation during surface creation and pixel format conversions.
- Streamlined rendering methods to ensure drawing operations align with the current surface orientation.
- Removed redundant code related to framebuffer handling.
* Fix review comments, add ability to test
* Some formatting
* Should be working now
* Remove fbdev changes
Theres really no point to do this in fbdev.
* Better method of rotating and transforming the canvas
* Remove breaking changes
* Switch to using a 2nd frame buffer in the rotation case
* Fix review comments
* Incorrect variable
* Fix sample
---------
Co-authored-by: davidw <davidw@icselectronics.co.uk>
* Remove the flowDirection parameter from TextCollapsingProperties.CreateCollapsedRuns
* Simplify text formatting constructors
* Update API suppressions
* Implemented LiveSetting property
* Make sure PropertyChanged callback is called on AvnAutomationPeer
* Remove `optional` from `AvnAccessibility`: we were never checking whether they respond to the selector or not anyway
* Formatting
* Use ARIA and Live Region Changed constants from mac APIs
* Fixed Mac build
* Reverted constants that don't exist on integration test XCode version
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Introduce TextOptions API
* Store BaselinePixelAlignment as byte. Move to a dedicated file.
* Update API suppressions
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Introduce a universal IGlyphTypeface implementation that does not rely on any platform implementation
* Revert changes
* Fix Android
* Make the test happy
* Fix build
* Update baseline
* Fix naming
* Fix headless
* Move interfaces to dedicated files
Make GlyphTypeface.GlyphCount an integer
* Fix GlyphCount
* Make IGlyphTypeface NotClientImplementable
* Make sure we cache platform typefaces by their desired name, style, weight and stretch
* Update baseline
* Only use IGlyphTypeface
* Fix Android
* Try to clear the buffer before we encode somethimg
* Add needed test font
* Add more unit tests
* Reduce allocations
* Remove Direct2D1 test files
* More tests
* More complete table implementations
* More adjustments
* Use batch APIs
* Handle invalid timestamps
* Update baseline
* Introduce a CharacterToGlyphMap struct for faster access
* Remove AggressiveInlining
* Remove AggressiveInlining
* Make the head table optional for legacy fonts
* Remove Load method. Fix TextBlockTests
* Fix nullables
* Remove redundant folder
* Update Api baseline
* revert diff helper changes
* revert changes
* Use bare minimum font for Headless platform and introduce a test font manager that uses the Inter font for testing.
* Add missing font file for Headless platform
---------
Co-authored-by: Gillibald <stebner@avaloniaui.net>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Added LandmarkType to automation properties
* Set AutomationProperties.AccessibilityView on Main landmark in IntegrationTestApp, which is required for Narrator to find the landmark
* Implement AXRoleDescription as suggested by W3C
* Fixed wrong role descriptions
* Remove netstandard2.0 from almost all projects
* Fix duplicated target frameworks in unit tests
* Fix DesignerSupport tests
* Fix Designer.HostApp packaging
* Build ControlCatalog.Desktop on CI
* Fix another bad auto merge
* Fix LeakTests duplicated target frameworks
* Don't hardcode target framework in DesignerSupportTests
* support reading images from clipboard(win32/android)
* Add DataFormat.Image. Prioritize png format when retrieving image from clipboard
* add browser support
* addressed comments
* win32 - add support for CF_DIB and CF_BITMAP formats
* win32 - add support for copying bitmaps to clipboard as DIB
* browser - add support for copying bitmap to clipboard
* Implement bitmap clipboard for iOS
* rename DataFormat.Image to DataFormat.Bitmap
* Implement Bitmap clipboard on macOS
* Use MemoryStream for bitmap clipboard/dnd on macOS backend
* Add public.jpeg support on macOS backend (convert it to png while in objc)
* Support TIFF format on iOS backend, by converting it to UIImage first
* Add Bitmap DND sample
* add clipboard bitmap support on linux
* simply bitmap format search on win32 clipboard
* fix linux clipboard image
* Bump MACOSX_DEPLOYMENT_TARGET
* Fix IDL incompatibility
* address review
* more reviews
* Fix Android crash on copy when a bitmap is present in the clipboard
* Handle any error that might occur pasting from an external content provider
* Add data transfer extension methods for Bitmap
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* new SuggestedFileType API
* Add impl for Win32 SuggestedFileType
* Impl suggestedFileType for GTK
* DBus impl
* Impl API for mac
* Add sample for suggested file filter
---------
Co-authored-by: Emmanuel Hansen <emmausssss@gmail.com>
* Add new SaveFilePickerWithResultAsync API to the base
* Add SaveFilePickerWithResultAsync stub impl
* Control Catalog SaveFilePickerWithResultAsync sample with XML and JSON types
* Make SaveFilePickerResult a struct
* Add managed picker implementation
* Make SaveFilePickerResult a readonly struct
* Windows implementation of SaveFilePickerWithResultAsync
* Test impl for dbus
* Reuse the file type object (FTO) so StorageFile consumer can match exactly the right FTO when receiving the SaveFilePicker's result.
* Add Gtk impl
* Avalonia.Native: surface selected save dialog filters
* macOS: report selected NSSavePanel filter
* Modify the conditional in case there's duplicate descriptions of FTO's in DBusSystemDialog.cs
* Instantiate FPFT as fallback
* Pass the mime/pattern to instantiated FPFT
* Update API diff
* Fix review comments
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>