From 2545daeb82e07aff3f5d6c96985f8b03d9597c03 Mon Sep 17 00:00:00 2001 From: maj00r Date: Sun, 4 Oct 2026 12:18:36 +0200 Subject: [PATCH] Close the vehicle catalogue on release, not on the double-click press Closing from DoubleTapped left the pointer captured by a dead window, and on Windows the main window stopped taking clicks. --- StarterNG/Views/TextureBaseWindow.axaml.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/StarterNG/Views/TextureBaseWindow.axaml.cs b/StarterNG/Views/TextureBaseWindow.axaml.cs index b081ded..c697356 100644 --- a/StarterNG/Views/TextureBaseWindow.axaml.cs +++ b/StarterNG/Views/TextureBaseWindow.axaml.cs @@ -50,6 +50,7 @@ public partial class TextureBaseWindow : Window modelList.SelectionChanged += (_, _) => Refresh(); textureList.ContextRequested += TextureList_OnContextRequested; + textureList.AddHandler(PointerReleasedEvent, TextureList_OnPointerReleased, handledEventsToo: true); Refresh(); } @@ -133,7 +134,16 @@ public partial class TextureBaseWindow : Window { if (textureList.SelectedItem is not TextureRow row) return; Picked = row.Texture; - Close(); + } + + // DoubleTapped is raised from the second press, while the list still holds the + // pointer. Closing there leaves the capture on a dead window and on Windows the + // owner stops taking clicks. The release ends the gesture and drops the capture, + // so that is where the window goes. + private void TextureList_OnPointerReleased(object? sender, PointerReleasedEventArgs e) + { + if (Picked != null) + Close(); } private void TextureList_OnContextRequested(object? sender, ContextRequestedEventArgs e)