Make sure mouse position is updated before hit test (#14139)

This commit is contained in:
Noisyfox
2026-06-11 02:47:33 +08:00
committed by GitHub
parent 847807adac
commit 06eefe7c1e

View File

@@ -807,6 +807,8 @@ wxAuiToolBarItem* BBLTopbar::FindToolByCurrentPosition()
}
#ifdef __WXMSW__
#include <windowsx.h>
WXLRESULT CenteredTitle::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
switch (nMsg) {
@@ -823,6 +825,8 @@ WXLRESULT BBLTopbar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam
{
switch (nMsg) {
case WM_NCHITTEST: {
m_last_mouse_position = ScreenToClient({GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)});
wxAuiToolBarItem* item = this->FindToolByCurrentPosition();
if (item != NULL && item->GetWindow() != m_title_ctrl) {
break;