mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 06:45:27 +02:00
Fix tab-closing crash by middle mouse button (unexpected mouse position)
The TabBar.h getTabIndexAt(int x, int y) could fail to find the tab-index (the underlying TCM_HITTEST WM returns -1, when there is no tab at the current mouse position). Fix #14328, close #14329
This commit is contained in:
parent
1fafd0dc0b
commit
5b61cc1680
@ -849,7 +849,8 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
||||
int xPos = LOWORD(lParam);
|
||||
int yPos = HIWORD(lParam);
|
||||
int currentTabOn = getTabIndexAt(xPos, yPos);
|
||||
notify(TCN_TABDELETE, currentTabOn);
|
||||
if (currentTabOn != -1)
|
||||
notify(TCN_TABDELETE, currentTabOn);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user