/// Auto-select from style under caret in idle time
void wxRichTextStyleListBox::OnIdle(wxIdleEvent& event)
{
- if (CanAutoSetSelection() && GetRichTextCtrl() && wxWindow::FindFocus() != this)
+ if (CanAutoSetSelection() && GetRichTextCtrl() && IsShownOnScreen() && wxWindow::FindFocus() != this)
{
wxString styleName = GetStyleToShowInIdleTime(GetRichTextCtrl(), GetStyleType());
if ( !richtext )
return;
- if ( !IsPopupShown() && wxWindow::FindFocus() != this )
+ if ( !IsPopupShown() && IsShownOnScreen() && wxWindow::FindFocus() != this )
{
wxString styleName =
wxRichTextStyleListBox::GetStyleToShowInIdleTime(richtext, m_stylePopup->GetStyleType());