543 Commits

Author SHA1 Message Date
Melissa 1e7f817547 Fixed wrong Mac roles used for List, ListItem, and StatusBar (#20681) 2026-02-13 15:57:55 +00:00
Julien Lebosquain 5f47b4be53 macOS: Ensure render target is at least 1x1 (#20610)
* Ensure Metal render target is at least 1x1

* Ensure software render target is at least 1x1
2026-02-05 11:51:42 +00:00
Melissa b775804b61 Implemented AutomationProperties.LiveSetting (#20473)
* 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>
2026-01-26 13:48:21 +00:00
Melissa a2a1663f4b Added automation peer for Expander control (#20475)
* Added `ExpanderAutomationPeer` for `Expander` control

* Use Group/"group" on UIA and NSAccessibilityDisclosureTriangleRole on AX

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2026-01-19 18:19:42 +00:00
Tim Miller 367d8b293b [Avalonia.Native] Use relative placement for detecting drag and drop locations. (#20280)
* Use relative position of view for drag and drop

* Add Drag And Drop Test

* Add AutomationProperties
2025-12-15 17:18:14 +01:00
Julien Lebosquain f46758f972 Implement macOS accessibility value setter (#20262) 2025-12-12 11:34:47 +00:00
Melissa d2817201cb Added LandmarkType to automation properties (#20134)
* 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
2025-11-26 14:49:28 +00:00
Emmanuel Hansen 4be786a5f6 Support reading from and copying images to clipboard (#19930)
* 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>
2025-11-15 04:35:07 +00:00
Sattar Imamov 7bbf4e1d71 - Fixed XButtons event handler for MacOs (#19997) 2025-11-08 11:13:37 +00:00
snowflysky da3d8207b8 macOS - Correct key mapping for scan code 0x18 (OemPlus instead of OemMinus) (#20009) 2025-11-07 09:13:47 +00:00
Tim Miller c811bd42ae [Avalonia.Native] Fix fullscreen transitions with ExtendClientAreaToDecorationsHint windows (#19939) 2025-10-29 06:58:36 +00:00
Jumar Macato 2c540873ec Add Impl for SaveFilePickerWithResultAsync API (#19783)
* 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>
2025-10-27 03:43:09 +00:00
Jumar Macato 67a88afb5d Add parent/automationPeer null guards on AvnWindow (#19805)
* Add parent/automationPeer null guards on AvnWindow

* Add null guards on AvnView
2025-10-10 14:54:47 +00:00
Nikita Tsukanov 22c4c630ce [OSX] Implemented IOSurface/MTLSharedEvent interop APIs (#18791)
* [OSX] Implemented IOSurface/MTLSharedEvent interop APIs

* Bump Xcode?

* Xcode?

* APIDiff

* Use different XCode versions because of how awesome appium is

* A hack for crapium

* Replace SkiaMetalApi usages

* Update API suppressions

---------

Co-authored-by: Timothy Miller <innerlogic4321@gmail.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2025-10-03 18:46:48 +02:00
Julien Lebosquain 1f404646fa Clipboard rework (#19347)
* New clipboard with IDataTransfer

* Move legacy format handling to DataObject wrappers

* macOS clipboard rework

* Browser clipboard rework

* Android clipboard rework

* iOS new clipboard

* X11 clipboard rework

* Simplify IDataTransfer API

* Simplify IClipboardImpl API

* Add DataFormat documentation

* Make DataFormat.SystemName platform specific

* Fix clipboard/DnD samples

* Fix native clipboard UTI conversion

* Adjust IDataTransfer namespaces

* Add Obsolete attributes to IDataObject related methods

* Better API for DataTransferItem

* Tizen clipboard rework

* Add missing clipboard extension methods

* Split IDataTransferItem into IAsyncDataTransferItem and ISyncDataTransferItem

* Rename back ISyncDataTransfer to IDataTransfer

* Added IClipboard API suppressions

* Make IPlatformDragSource NotClientImplementable

* Rename DataFormatKinds

* Added DataTransferItem.CreateText/File

* Implemented typed DataFormat<T>

* Fix X11 text/uri-list encoding

* Add API suppressions

* Adjust ClipboardUriListHelper stream ownership

* Fix legacy clipboard BinaryFormatter deserialization

* Fix macOS build
2025-10-01 11:47:09 +00:00
Tim Miller 650aeb20c6 [OSX] Move Drag and Drop logic to TopLevelImpl (#19731)
* Move Drag and Drop logic to TopLevelImpl

* Update src/Avalonia.Native/TopLevelImpl.cs

Co-authored-by: Max Katz <maxkatz6@outlook.com>

---------

Co-authored-by: Max Katz <maxkatz6@outlook.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
2025-09-30 05:52:57 +00:00
Melissa a8f3628da9 Added HeadingLevel to AutomationProperties (#19696)
* Added HeadingLevel to AutomationProperties

* Added support for HeadlingLevel accessibility on Mac
2025-09-27 11:50:44 +00:00
Tim Miller 628b9db5cb Adjust macOS Tray/Menu icons scaling (#19628)
* Set TrayIcon image size to 17, 17

* Use Floor for setting icon size
2025-09-12 08:01:44 +00:00
Vladislav Pozdniakov 4f666f0ba1 Fix macOS thick titlebar mouse event duplication (#19447)
* Added failing test for OSXThickTitleBar single title area click produce double click #19320

* Fixed OSXThickTitleBar title area click duplication and event delays until the event-tracking-loop is completed

* IntegrationTestApp. Move event counter controls to a separate column. Fixes Changing_Size_Should_Not_Change_Position test

* Move pointer tests to Default group to avoid interference

* Try to fix CI crash

* Try disabling test

* Fix CI test. Collection back to Default

* CI fix. Return back empty test.

* CI fix. Minimal bug test

* CI test. Add double click test

* CI fix. Remove double click test.

---------

Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
2025-08-15 11:21:01 +00:00
Julien Lebosquain 34e6d14577 Remove non implemented message AvnView.resetPressedMouseButtons (#19445) 2025-08-14 08:58:58 +00:00
Julien Lebosquain 1f8701a2fc Add Window.CanMinimize/CanMaximize (#18117)
* Add CanMinimize and CanMaximize to Window

* Win32 impl for CanMinimize/CanMaximize

* Add CanResize/CanMinimize/CanMaximize samples to control catalog

* X11 impl for CanMinimize/CanMaximize

* macOS impl for CanMinimize/CanMaximize

* Win32: don't allow restore when the window isn't resizable

* Additional documentation for CanMinimize/CanMaximize

* Add CanMinimize/CanMaximize logic to CaptionButtons

* Use START_COM_ARP_CALL

* Added CanMinimize/CanMaximize integration tests

* Fixed CanMaximize tests on macOS
2025-08-13 08:35:52 +00:00
Vladislav Pozdniakov 3ad4973b58 Fixes/osx thick titlebar pointer events streaming, (tabs interface) #15696 (#19320)
* Added failing test for OSXThickTitleBar drag events outside thick title area

* MacOS. Added event tracking loop for drag events started in thick titlebar (NSToolbar)

* Review fix: forward events to AppKit during tracking loop (#19320)
2025-07-30 11:45:10 +00:00
Tim Miller 6f27538a33 [Avalonia.Native] Replace manual input tracking with NSEvent (#19101) 2025-06-24 07:18:47 +00:00
Tim Miller b25a438d6f [Avalonia.Native] Add shouldResize value to SetWindowState, don't resize on Window move (#19088)
* [Avalonia.Native] Add shouldResize value to SetWindowState, don't resize on Window move

* Handle Window move as well

* Wrap around Switch
2025-06-19 13:14:33 +00:00
Tim Miller b5b5ec2d38 [Avalonia.Native] Respect info.plist values for setActivationPolicy (#19066)
* [Avalonia.Native] Respect info.plist values

* Only set setActivationPolicy if it's different from the users default
2025-06-17 08:24:56 +00:00
Whiletru3 1231aba155 Fix for #19035 On macOS, the SuggestedStartLocation is not set if the FileTypeChoices Is not null (#19036) 2025-06-11 23:48:17 +00:00
Julien Lebosquain 950da6eaf6 Fix LostFocus not raised on macOS (#18990) 2025-06-03 23:01:09 +00:00
AnastassiaP 94ee541998 Fix null reference crash when window is closed during drag-and-drop (#18760) 2025-04-30 15:35:08 +00:00
Nikita Tsukanov 5ebaf7e651 Replace raw pointer with ComObjectWeakPtr<T> (#18757) 2025-04-30 14:55:51 +00:00
Nikita Tsukanov c3b4d61b8a Added IClipboard:TryGetInProcessDataObjectAsyns (#18340)
* Implemented IClipboard.TryGetInProcessDataObjectAsync for X11

* [Win32] Implemented TryGetInProcessDataObjectAsync

* Rest of the platforms

* Run `nuke ValidateApiDiff`

---------

Co-authored-by: Max Katz <maxkatz6@outlook.com>
2025-03-12 16:22:49 +00:00
Julien Lebosquain 8bc116f9f1 Fix NSEvent.subType assertion (#18126) 2025-02-05 16:16:45 +00:00
Aki Sakurai 21ecbf384b feat: Support pressure and tilt on macos (#18082)
* feat: Support pressure and tilt on macos

* apply suggestions

* apply suggestion
2025-02-01 19:46:03 +00:00
Maxwell Katz 6f27eecb2a End/close AppKit sheets attached on window when we hide it (#17968) 2025-01-15 07:39:32 +00:00
Julien Lebosquain 032cdcb4c7 [macOS] Prevent popups from stealing focus (#17794) 2024-12-17 15:34:12 +00:00
Julien Lebosquain 3e1940f766 Fix Closed not being called for macOS popups (#17753) 2024-12-11 23:10:05 +00:00
Steven Kirk d3a2b08664 Don't set _isModal when changing window parent. (#17742)
The modality of a window is decided at the time it is shown, and indicated by the `isDialog` parameter to `WindowImpl::Show`.

The code was also rather confusing in that `_isModal` was defined in `WindowBaseImpl` but `WindowBaseImpl.IsModal` always returned false. `WindowImpl.IsModal` then overrode `IsModal` to return WindowBaseImpl._isModal. That's messed up. Just define `_isModal` in `WindowImpl` not `WindowBaseImpl`.
2024-12-10 15:25:32 +00:00
Jumar Macato aa858f3b4e Add missing nullcheck in AvnView::mouseEvent (#17709) 2024-12-08 13:38:03 +08:00
Julien Lebosquain c851c7a310 Fix macOS ActivatableLifetime events (#17608) 2024-11-25 18:24:42 -08:00
Max Katz 7aff154709 Use URLWithString for pickers (#17594) 2024-11-23 10:30:26 +00:00
Nikita Tsukanov 42b7b5eacb Added generate-headers.sh for convenience purposes (#17413) 2024-11-03 13:01:51 +01:00
Nikita Tsukanov 4684d9e81e Create an autorelease pool for every render timer tick (#17414) 2024-11-02 15:14:56 -07:00
Steven Kirk cb4b69894a Ensure field is initialized. (#17218) 2024-10-08 14:14:52 -07:00
Nikita Tsukanov b17153f9aa Don't apply our weird window positioning hacks for clicks on traffic lights (#17181)
This hack fixes the minimize problem with macOS 15.0
2024-10-03 08:15:03 +00:00
ahopper 05389af98e Fix AutomationProperties.HelpText on macos (#17046)
* fix Automation.HelpText on windows

* fix AutomationProperties.HelpText on macos

* change breaking abstract to virtual

* only fall back to tooltip if string

* remove duplicate override

* fix AutomationProperties.HelpText on macos
2024-09-24 09:21:31 +00:00
Nikita Tsukanov e2a07cc04d [AVN] Introduced ComObjectWeakPtr (#17041) 2024-09-24 09:17:47 +00:00
Steven Kirk 8c043d5900 Call layer.setNeedsDisplay on show. (#17096)
The `AvaloniaNative.GlPlatformSurface.CreateGlRenderTarget` method can only be called on the UI thread. In normal circumstances this method is called in response to a call to `TopLevel.HandlePaint` from the native `AvnView.updateLayer` method. However, a customer was experiencing a problem where `AvnView.updateLayer` and by extension `TopLevel.HandlePaint` were being called before the window is shown. This broke the creation of the GL render target.
2024-09-23 17:28:23 +00:00
Julien Lebosquain 49fb9ff34c [macOS] Fixes stuck mouse buttons after drag (#17035)
* Reset pressed mouse buttons on drag on macOS

* Make draggable borders easier to click in ControlCatalog
2024-09-18 10:08:20 +00:00
Julien Lebosquain a31ff27fdf Fixes stuck modifier keys on focus lost on macOS (#16788)
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
2024-09-11 20:00:53 -07:00
Steven Kirk c6cdbfec3b Add basic integration tests for NativeControlHost and improve its automation/a11y support. (#15542)
* Added embedding page to IntegrationTestApp.

Currently embeds a lone native text box, and only when running on Windows.

* Win32 automation support for native control host.

Allows native controls to appear in the Avalonia automation tree as a child of the `NativeControlHost`. They also appear in the _wrong_ place - as a direct child of the `Window` - but this appears to be expected behavior as it happens when hosting a win32 control in WPF as well.

* Basic native control integration test on win32.

* Test editing native win32 control in popup.

* Add embedded text box on macOS.

* macOS automation support for native control host.

Implements special-casing of `InteropAutomationPeer`on macOS.

* Make native control integration test work on macOS.

The test for the native control in a popup is disabled on macOS because we have a bug there.

* Add missing parts

* Fix build error

* Skip test to see if CI passes again.

* Log more info about integration tests on win32.

* Try to fix flaky test.

* The tests won't yet work on macOS yet.

Will require #16577.

---------

Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
2024-08-05 11:32:20 -07:00
Ikko Eltociear Ashimine fc70228dc9 chore: update comimpl.h (#16011)
beggining -> beginning
2024-07-29 20:39:38 +00:00