Skip to content

Commit 022f749

Browse files
committed
fix(WeaselUI): hover will be triggered, when panel is first created with mouse on some candidate, event mouse not moved, incomplete edit of b3d161e
1 parent 9b2943c commit 022f749

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

WeaselUI/WeaselPanel.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,11 @@ LRESULT WeaselPanel::OnMouseMove(UINT uMsg,
483483
// Ignore if mouse screen position not changed
484484
CPoint ptScreen = point;
485485
ClientToScreen(&ptScreen);
486-
if (ptScreen == m_lastMousePos)
486+
if (ptScreen == m_lastMousePos || m_lastMousePos.x == -1) {
487+
if (m_lastMousePos.x == -1)
488+
m_lastMousePos = ptScreen;
487489
return 0;
490+
}
488491
m_lastMousePos = ptScreen;
489492

490493
for (size_t i = 0; i < m_candidateCount && i < MAX_CANDIDATES_COUNT; ++i) {
@@ -1151,6 +1154,7 @@ LRESULT WeaselPanel::OnDestroy(UINT uMsg,
11511154
LPARAM lParam,
11521155
BOOL& bHandled) {
11531156
m_hoverIndex = -1;
1157+
m_lastMousePos = {-1, -1};
11541158
m_sticky = false;
11551159
delete m_layout;
11561160
m_layout = NULL;

0 commit comments

Comments
 (0)