diff --git a/api/Avalonia.Diagnostics.nupkg.xml b/api/Avalonia.Diagnostics.nupkg.xml
new file mode 100644
index 0000000000..d364618e59
--- /dev/null
+++ b/api/Avalonia.Diagnostics.nupkg.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ CP0001
+ T:CompiledAvaloniaXaml.!AvaloniaResources.NamespaceInfo:/Diagnostics/Views/ConsoleView.xaml
+ baseline/netstandard2.0/Avalonia.Diagnostics.dll
+ target/netstandard2.0/Avalonia.Diagnostics.dll
+
+
\ No newline at end of file
diff --git a/packages/Avalonia/AvaloniaPrivateApis.targets b/packages/Avalonia/AvaloniaPrivateApis.targets
index 5343559c07..5f69187d92 100644
--- a/packages/Avalonia/AvaloniaPrivateApis.targets
+++ b/packages/Avalonia/AvaloniaPrivateApis.targets
@@ -21,6 +21,6 @@
-
+
diff --git a/samples/GpuInterop/VulkanDemo/VulkanContent.cs b/samples/GpuInterop/VulkanDemo/VulkanContent.cs
index a9a668d10b..fe95db00f4 100644
--- a/samples/GpuInterop/VulkanDemo/VulkanContent.cs
+++ b/samples/GpuInterop/VulkanDemo/VulkanContent.cs
@@ -182,10 +182,11 @@ unsafe class VulkanContent : IDisposable
api.CmdSetScissor(commandBufferHandle, 0, 1, &scissor);
- var clearColor = new ClearValue(new ClearColorValue(1, 0, 0, 0.1f), new ClearDepthStencilValue(1, 0));
-
- var clearValues = new[] { clearColor, clearColor };
-
+ var clearValues = new ClearValue[]
+ {
+ new() { Color = new ClearColorValue { Float32_0 = 1, Float32_1 = 0, Float32_2 = 0, Float32_3 = 0.1f } },
+ new() { DepthStencil = new ClearDepthStencilValue { Depth = 1, Stencil = 0 } }
+ };
fixed (ClearValue* clearValue = clearValues)
{
@@ -195,7 +196,7 @@ unsafe class VulkanContent : IDisposable
RenderPass = _renderPass,
Framebuffer = _framebuffer,
RenderArea = new Rect2D(new Offset2D(0, 0), new Extent2D((uint?)image.Size.Width, (uint?)image.Size.Height)),
- ClearValueCount = 2,
+ ClearValueCount = (uint)clearValues.Length,
PClearValues = clearValue
};
diff --git a/src/Avalonia.Controls/Control.cs b/src/Avalonia.Controls/Control.cs
index 13e2a02fe5..d317d972d2 100644
--- a/src/Avalonia.Controls/Control.cs
+++ b/src/Avalonia.Controls/Control.cs
@@ -380,10 +380,13 @@ namespace Avalonia.Controls
private void OnHoldEvent(object? sender, HoldingRoutedEventArgs e)
{
- if (!e.Handled && e.HoldingState == HoldingState.Started)
+ if (e.Source == this && !e.Handled && e.HoldingState == HoldingState.Started)
{
// Trigger ContentRequest when hold has started
- RaiseEvent(e.PointerEventArgs is { } ev ? new ContextRequestedEventArgs(ev) : new ContextRequestedEventArgs());
+ var contextEvent = e.PointerEventArgs is { } ev ? new ContextRequestedEventArgs(ev) : new ContextRequestedEventArgs();
+ RaiseEvent(contextEvent);
+
+ e.Handled = contextEvent.Handled;
}
}
diff --git a/src/Avalonia.Controls/Selection/SelectionModel.cs b/src/Avalonia.Controls/Selection/SelectionModel.cs
index 5402499fcf..22d4a371e5 100644
--- a/src/Avalonia.Controls/Selection/SelectionModel.cs
+++ b/src/Avalonia.Controls/Selection/SelectionModel.cs
@@ -69,6 +69,18 @@ namespace Avalonia.Controls.Selection
get => _selectedIndex;
set
{
+ if (_operation is not null && _operation.UpdateCount == 0)
+ {
+ // An operation is in the process of being committed. In this case, if the new
+ // value for SelectedIndex is unchanged then we need to ignore it. It could be
+ // the result of a two-way binding to SelectedIndex writing back to the
+ // property. The binding system should really be fixed to ensure that it's not
+ // writing back the same value, but this is a workaround until the binding
+ // refactor is complete. See #13676.
+ if (value == _selectedIndex)
+ return;
+ }
+
using var update = BatchUpdate();
Clear();
Select(value);
@@ -675,8 +687,6 @@ namespace Avalonia.Controls.Selection
}
}
-
-
if (raisePropertyChanged)
{
if (oldSelectedIndex != _selectedIndex)
diff --git a/src/Avalonia.Controls/ToggleSwitch.cs b/src/Avalonia.Controls/ToggleSwitch.cs
index 49d01d9f65..697dc4c2d0 100644
--- a/src/Avalonia.Controls/ToggleSwitch.cs
+++ b/src/Avalonia.Controls/ToggleSwitch.cs
@@ -228,6 +228,8 @@ namespace Avalonia.Controls
{
if (_isDragging)
{
+ e.Handled = true;
+
bool shouldBecomeChecked = Canvas.GetLeft(_knobsPanel!) >= (_switchKnob!.Bounds.Width / 2);
_knobsPanel!.ClearValue(Canvas.LeftProperty);
diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs
index 0f535500bc..44c997f555 100644
--- a/src/Avalonia.Controls/Window.cs
+++ b/src/Avalonia.Controls/Window.cs
@@ -209,6 +209,7 @@ namespace Avalonia.Controls
CreatePlatformImplBinding(WindowStateProperty, state => PlatformImpl!.WindowState = state);
CreatePlatformImplBinding(ExtendClientAreaToDecorationsHintProperty, hint => PlatformImpl!.SetExtendClientAreaToDecorationsHint(hint));
CreatePlatformImplBinding(ExtendClientAreaChromeHintsProperty, hint => PlatformImpl!.SetExtendClientAreaChromeHints(hint));
+ CreatePlatformImplBinding(ExtendClientAreaTitleBarHeightHintProperty, height => PlatformImpl!.SetExtendClientAreaTitleBarHeightHint(height));
CreatePlatformImplBinding(MinWidthProperty, UpdateMinMaxSize);
CreatePlatformImplBinding(MaxWidthProperty, UpdateMinMaxSize);
diff --git a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
index 289f239ec1..dfe2691f96 100644
--- a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
+++ b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
@@ -17,10 +17,6 @@
-
-
-
-
diff --git a/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleContext.cs b/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleContext.cs
deleted file mode 100644
index 4fd3de25dd..0000000000
--- a/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleContext.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma warning disable IDE1006 // Naming Styles
-
-using Avalonia.Diagnostics.ViewModels;
-
-namespace Avalonia.Diagnostics.Models
-{
- internal class ConsoleContext
- {
- private readonly ConsoleViewModel _owner;
-
- internal ConsoleContext(ConsoleViewModel owner) => _owner = owner;
-
- public readonly string help = @"Welcome to Avalonia DevTools. Here you can execute arbitrary C# code using Roslyn scripting.
-
-The following variables are available:
-
-e: The control currently selected in the logical or visual tree view
-root: The root of the visual tree
-
-The following commands are available:
-
-clear(): Clear the output history
-";
-
- public dynamic? e { get; internal set; }
- public dynamic? root { get; internal set; }
-
- internal static object NoOutput { get; } = new object();
-
- public object clear()
- {
- _owner.History.Clear();
- return NoOutput;
- }
- }
-}
diff --git a/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleHistoryItem.cs b/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleHistoryItem.cs
deleted file mode 100644
index 86da18145a..0000000000
--- a/src/Avalonia.Diagnostics/Diagnostics/Models/ConsoleHistoryItem.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using Avalonia.Media;
-
-namespace Avalonia.Diagnostics.Models
-{
- internal class ConsoleHistoryItem
- {
- public ConsoleHistoryItem(string input, object output)
- {
- Input = input;
- Output = output;
- Foreground = output is Exception ? Brushes.Red : Brushes.Green;
- }
-
- public string Input { get; }
- public object Output { get; }
- public IBrush Foreground { get; }
- }
-}
diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ConsoleViewModel.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ConsoleViewModel.cs
deleted file mode 100644
index 717b49d074..0000000000
--- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ConsoleViewModel.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-using System;
-using System.Reflection;
-using System.Threading.Tasks;
-using Avalonia.Collections;
-using Avalonia.Diagnostics.Models;
-using Microsoft.CodeAnalysis.CSharp.Scripting;
-using Microsoft.CodeAnalysis.Scripting;
-
-namespace Avalonia.Diagnostics.ViewModels
-{
- internal class ConsoleViewModel : ViewModelBase
- {
- private readonly ConsoleContext _context;
- private readonly Action _updateContext;
- private int _historyIndex = -1;
- private string _input;
- private bool _isVisible;
- private ScriptState