Toggling the window decorations can cause the window to be moved off screen, causing integration test failures. Until this bug is fixed, detect this and move the window to the screen origin. See #11411.
#14982 added some logic from WPF to contrain a window showed with `WindowStartupLocation.CenterOwner` to the screen, but it had a bug: the screen used was the screen that the window being _shown) is currently on, not the _owner_ window.
This means that if the owner window is on a different screen to the window being shown then it will be constrained to the wrong screen.
You can see this on Windows by showing a child `Window` with `CenterOwner` when the owner window is on a secondary screen: the child window will initially be shown on the primary screen and so the constraint will be wrong, resulting in the child window being shown on the wrong screen.
* [Android] fix a bug which cause closing soft keyboard does not clear focus on TextBox, which makes clicking on the TextBox cannot call out the soft keyboard again
* change way to show soft keyboard
* add new api
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Fixed overlay popups not automatically closing
* Fix overlay tooltip tests not actually generating overlay tooltips
Verify popup type whenever we verify that the popup is open
* Fixed overlay tooltips not being attached to the visual tree in tests
#Conflicts:
# tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
* Record video for failing win32 integration tests.
* Be more specific when selecting the test dll.
https://github.com/microsoft/vstest/issues/3939
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Refactor IntegrationTestApp.
Use a `ListBox` to switch pages instead of a `TabControl`: the `TabControl` didn't adapt well to smaller screen sizes, and the `MainWindow` was getting unwieldy anyway.
* Update tests to use new pager.
Move logic for selecting the page to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically).
* Add AutomationPeer.IsOffscreen.
This is needed in order for controls to be scrolled into view using WinAppDriver. The default is the same as WPF and the default value is overridden in the same controls as WPF (where present).
#Conflicts:
# samples/IntegrationTestApp/App.axaml.cs
# samples/IntegrationTestApp/MainWindow.axaml
# samples/IntegrationTestApp/MainWindow.axaml.cs
# samples/IntegrationTestApp/TopmostWindowTest.axaml.cs
# src/Avalonia.Controls/TreeViewItem.cs
# tests/Avalonia.IntegrationTests.Appium/ContextMenuTests.cs
# tests/Avalonia.IntegrationTests.Appium/PointerTests.cs
# tests/Avalonia.IntegrationTests.Appium/ScreenTests.cs
# tests/Avalonia.IntegrationTests.Appium/TrayIconTests.cs
# tests/Avalonia.IntegrationTests.Appium/WindowDecorationsTests.cs
# tests/Avalonia.IntegrationTests.Appium/WindowTests.cs
# tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs
* Make it work on macOS
* Revert most of changes
This reverts commit 3526c6f601.
* Polyfill appium2, make it usable with both versions
* Revert unrelated changes
* Fix slider incompatibility
* Change namespace to prevent conflicts.
The `DataGrid` in the namespace name was hiding the `DataGrid` type.
* Initial impl of bindable DataGridRow.IsSelected.
* Make DataGridRow.IsSelected two-way bindable.
* Updated Popup to raise the pass-through overlay dismiss event prior to possibly closing the popup when a pointer is pressed. Added the PopupFlyoutBase.OverlayDismissEventPassThrough property and updated logic in Button.
* Updated SplitButton logic to handle OverlayDismissEventPassThrough scenarios.
* Updated CalendarDatePicker logic to handle OverlayDismissEventPassThrough scenarios.
* Updated ComboBox logic to handle OverlayDismissEventPassThrough scenarios.
* Removed unncessary ComboBox.PopupClosed logic that focused the control. This was problematic when the popup was open with OverlayDismissEventPassThrough and clicking onto another control. Focus would not move to the clicked control.
* Fixed the Clicking_On_Control_PseudoClass unit test to properly recognize pseudo-class behavior change.
* Added a couple unit tests to FlyoutTests.
When opening a context menu and pressing the "arrow down" key, the first menu item was not selected. This issue was introduced by #11287. The fix is to make the `ContextMenu` focusable.
Added an integration test to try to prevent regressions.
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Fix NUnit test context not being properly set
* Add failing tests
* Capture ExecutionContext to keep async locals
* Remove explicit EstablishExecutionEnvironment call, as it was a bad idea
* Make ExecutionContext usage disabled by default, and only enabled for NUnit
* Add a failing test for #15712.
* Validate StartU at the start of a measure pass.
If any container U size has changed since the last layout pass then `StartU` must be considered unstable as the average container height will have changed.
* Correctly position focused element.
If the focused element has been moved outside the visible viewport due to a realized container size change, then we need to ensure it's positioned correctly.
* We can skip check if StartU is already unstable.
* Don't invalidate virt. panels more than necessary.
* Add another virt panel test.
And revert the expected results for another test to the way they were at the beginning of this PR.
* Tweak container size estimation.
Use the desired size of _measured_ containers instead of the bounds: a layout pass may not had completed on the containers yet, so the bounds may not be up-to-date. Was easier to move the estimation methods out of `RealizedStackElements` and into `VirtualizingStackPanel` itself in order to do this, and arguably makes more sense.
* Add failing test for #16113.
* Convert delegate to ICommand in style setter.
When compiling a binding to e.g. `Button.Command` in a style `Setter`, we were not converting `XamlIlClrMethodPathElementNode` to `XamlIlClrMethodAsCommandPathElementNode` as we were only testing whether the property that the binding was being assigned to is an `ICommand`.
If we detect that we're assigning the binding to a `Setter.Value` then we need to look in the `Setter.Property` to see check whether the property is an `ICommand` too.
Fixes#16113
* Add tests for binding negation operator.
Expected results come from 11.0.x branch.
* Unset and null need to be distinct.
Also remove `ExpressionNode.Reset` as it was doing unneeded stuff and should just be the same as `SetSource(AvaloniaProperty.UnsetValue, null);`.
* Make ExpressionNode.OnSourceChanged accept null.
The previous design assumed that a source of `null` was an invalid input to all types of expression nodes. It turned out that there was a single exception to this rule: the `!` operator can in fact operate on a null value. With this new design we instead have to explicitly check for a null value in every override of `OnSourceChanged ` except in `LogicalNotNode`.
Due to this change, we also have to distinguish between `null` and `(unset)` in `ExpressionNode.SetSource` as well.
Fixes#16071
* Fix comment.