From 597a2cc83157859276241fc09f0ec0506be3d90f Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 20 Apr 2021 19:42:41 -0300 Subject: [PATCH] Redir first kMouseMoveMessage with correct mouse position from combobox -> listbox --- src/ui/combobox.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/ui/combobox.cpp b/src/ui/combobox.cpp index d1a556f52..b04562dd4 100644 --- a/src/ui/combobox.cpp +++ b/src/ui/combobox.cpp @@ -516,19 +516,23 @@ bool ComboBoxEntry::onProcessMessage(Message* msg) case kMouseMoveMessage: if (hasCapture()) { MouseMessage* mouseMsg = static_cast(msg); - Widget* pick = manager()->pickFromScreenPos( - mouseMsg->display()->nativeWindow()->pointToScreen(mouseMsg->position())); + gfx::Point screenPos = mouseMsg->display()->nativeWindow()->pointToScreen(mouseMsg->position()); + Widget* pick = manager()->pickFromScreenPos(screenPos); Widget* listbox = m_comboBox->m_listbox; if (pick != nullptr && (pick == listbox || pick->hasAncestor(listbox))) { releaseMouse(); - MouseMessage mouseMsg2(kMouseDownMessage, - mouseMsg->pointerType(), - mouseMsg->button(), - mouseMsg->modifiers(), - mouseMsg->position()); + MouseMessage mouseMsg2( + kMouseDownMessage, + mouseMsg->pointerType(), + mouseMsg->button(), + mouseMsg->modifiers(), + (mouseMsg->display() == pick->display() ? + mouseMsg->position(): + pick->display()->nativeWindow()->pointFromScreen(screenPos))); + mouseMsg2.setDisplay(pick->display()); pick->sendMessage(&mouseMsg2); return true; }