From 16b324424c19ab6013ed1c622144f6e83d189812 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 19 Aug 2021 11:43:14 +0800 Subject: [PATCH] fix: show dragdrop effect only when current tab is selected --- src/Views/Widgets/PageTabBar.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Views/Widgets/PageTabBar.xaml.cs b/src/Views/Widgets/PageTabBar.xaml.cs index 2abccf9d..3ba5e38c 100644 --- a/src/Views/Widgets/PageTabBar.xaml.cs +++ b/src/Views/Widgets/PageTabBar.xaml.cs @@ -251,7 +251,10 @@ namespace SourceGit.Views.Widgets { var item = sender as ListBoxItem; if (item == null) return; - if (Mouse.LeftButton == MouseButtonState.Pressed) { + var tab = item.DataContext as Tab; + if (tab == null || tab != container.SelectedItem) return; + + if (e.LeftButton == MouseButtonState.Pressed) { var dragging = new Controls.DragDropAdorner(item); DragDrop.DoDragDrop(item, item.DataContext, DragDropEffects.Move); dragging.Remove();