Skip to content

Commit

Permalink
ReportIf() => ReportDebugIf() in UpdateAfterDrag(); prevent calling i…
Browse files Browse the repository at this point in the history
…t if h == -1
  • Loading branch information
kjk committed Aug 15, 2024
1 parent 9c60a88 commit 3ab7a10
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wingui/WinGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3356,7 +3356,7 @@ static void UpdateAfterDrag(TabsCtrl* tabsCtrl, int tab1, int tab2) {
bool badState = (tab1 == tab2) || (tab1 < 0) || (tab2 < 0) || (tab1 >= nTabs) || (tab2 >= nTabs);
if (badState) {
logfa("tab1: %d, tab2: %d, nTabs: %d\n", tab1, tab2, nTabs);
ReportIf(true);
ReportDebugIf(true);
return;
}

Expand Down Expand Up @@ -3494,10 +3494,13 @@ LRESULT TabsCtrl::WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
ImageList_DragEnter(NULL, p.x, p.y);
return 0;
}

if (hl != tabUnderMouse) {
tabHighlighted = tabUnderMouse;
// logf("tab: WM_MOUSEMOVE: tabHighlighted = tabUnderMouse: %d\n", tabHighlighted);
if (isDragging) {
// note: hl == -1 possible repro: we start drag, a file gets loaded via DDE etc.
// which re-layouts tabs and mouse is no longer over a tab
if (isDragging && hl != -1) {
// send notification if the highlighted tab is dragged over another
if (!GetTab(tabUnderMouse)->isPinned) {
if (gLogTabs) {
Expand Down

0 comments on commit 3ab7a10

Please sign in to comment.