Opened 13 months ago

Last modified 12 months ago

#15404 new defect

wxRichTextCtrl : caret does not disappear when focus is lost (Mac)

Reported by: briceandre Owned by:
Priority: normal Milestone:
Component: wxRichText Version: 2.9.4
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

Dear all,

I have a problem with wxRichTextCtrl under mac (wxWidgets 2.9.4) : when leaving the control, the caret remains displayed.

After some investigation, I found that the cause of the bug is that the control never receives the wxFocusEvent when the focus is lost.

I did not found why the focus event is not received, but I found a simple workaround : when the caret blinks, I check if the control is still displayed. If no, I hide the caret.

Regards,

Brice

PS: in order to apply the workaround described here above, one shall replace the function "wxRichTextCaret::Notify" by the following:

void wxRichTextCaret::Notify()
{

if (m_richTextCtrl &&

!m_richTextCtrl->HasFocus())

{

Hide();
return;

}
else
{

m_flashOn = !m_flashOn;
Refresh();

}

}

Change History (1)

comment:1 Changed 12 months ago by robind

See also #14142

Note: See TracTickets for help on using tickets.