Fix rapid swapping between two tabs during tab drag and drop.

Closes 3328, Fixes #3017, fixes #2771
This commit is contained in:
AngryGamer 2017-05-28 16:41:38 -07:00 committed by Don HO
parent a00a913752
commit 6b0977b0b8
2 changed files with 12 additions and 0 deletions

View File

@ -1194,13 +1194,24 @@ void TabBarPlus::exchangeItemData(POINT point)
if (nTab != _nTabDragged) if (nTab != _nTabDragged)
{ {
if (_previousTabSwapped == nTab)
{
return;
}
exchangeTabItemData(_nTabDragged, nTab); exchangeTabItemData(_nTabDragged, nTab);
_previousTabSwapped = _nTabDragged;
_nTabDragged = nTab; _nTabDragged = nTab;
} }
else
{
_previousTabSwapped = -1;
}
} }
else else
{ {
//::SetCursor(::LoadCursor(_hInst, MAKEINTRESOURCE(IDC_DRAG_TAB))); //::SetCursor(::LoadCursor(_hInst, MAKEINTRESOURCE(IDC_DRAG_TAB)));
_previousTabSwapped = -1;
_isDraggingInside = false; _isDraggingInside = false;
} }

View File

@ -229,6 +229,7 @@ protected:
bool _isDraggingInside = false; bool _isDraggingInside = false;
int _nSrcTab = -1; int _nSrcTab = -1;
int _nTabDragged = -1; int _nTabDragged = -1;
int _previousTabSwapped = -1;
POINT _draggingPoint; // coordinate of Screen POINT _draggingPoint; // coordinate of Screen
WNDPROC _tabBarDefaultProc = nullptr; WNDPROC _tabBarDefaultProc = nullptr;