diff --git a/ILSpy/AssemblyTree/AssemblyListPane.axaml.cs b/ILSpy/AssemblyTree/AssemblyListPane.axaml.cs index f5142b9d6..53d6b7ae9 100644 --- a/ILSpy/AssemblyTree/AssemblyListPane.axaml.cs +++ b/ILSpy/AssemblyTree/AssemblyListPane.axaml.cs @@ -50,10 +50,12 @@ namespace ILSpy.AssemblyTree InitializeComponent(); TreeGrid.DoubleTapped += OnTreeGridDoubleTapped; TreeGrid.KeyDown += OnTreeGridKeyDown; - // Tunnelling subscription so the MMB is observed before the DataGrid's own - // pointer handling claims it. + // Bubble + handledEventsToo: ProDataGrid's row-level pointer handlers mark + // PointerPressed handled before bubble reaches our subscription, so we have to + // opt into "see handled events too" to react. TreeGrid.AddHandler(PointerPressedEvent, OnTreeGridPointerPressed, - global::Avalonia.Interactivity.RoutingStrategies.Tunnel); + global::Avalonia.Interactivity.RoutingStrategies.Bubble, + handledEventsToo: true); // Context-menu host. Tests bypass this and re-attach via AttachContextMenu so they // can inject stub entries — at app-runtime we resolve the registry through the diff --git a/ILSpy/Views/MetadataTablePage.axaml.cs b/ILSpy/Views/MetadataTablePage.axaml.cs index c0251cb34..1ef5ec8d0 100644 --- a/ILSpy/Views/MetadataTablePage.axaml.cs +++ b/ILSpy/Views/MetadataTablePage.axaml.cs @@ -61,10 +61,14 @@ namespace ILSpy.Views if (grid is not null) { grid.DoubleTapped += OnGridDoubleTapped; - // Subscribe at the tunnelling phase so the middle-click is observed before - // the DataGrid's own selection / scroll handling can swallow it. + // Bubble + handledEventsToo: ProDataGrid's row-level pointer handlers mark + // PointerPressed handled before bubble reaches our subscription, so we have to + // opt into "see handled events too" to react. Tunnel was tried first but + // ProDataGrid's hierarchy seemingly intercepts the tunnel pass for non-primary + // buttons — bubble + handledEventsToo is the reliable path. grid.AddHandler(PointerPressedEvent, OnGridPointerPressed, - global::Avalonia.Interactivity.RoutingStrategies.Tunnel); + global::Avalonia.Interactivity.RoutingStrategies.Bubble, + handledEventsToo: true); } }