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();