Performance optimization
authorJulian Smart <julian@anthemion.co.uk>
Thu, 14 Feb 2008 11:01:18 +0000 (11:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 14 Feb 2008 11:01:18 +0000 (11:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51783 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextstyles.cpp

index a171a8b60ad998f55132b72912e9618a3c9735de..0ce957ad79396c22961df3fcfbc98584157140af 100644 (file)
@@ -756,7 +756,7 @@ wxString wxRichTextStyleListBox::GetStyleToShowInIdleTime(wxRichTextCtrl* ctrl,
 /// 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());
 
@@ -1114,7 +1114,7 @@ void wxRichTextStyleComboCtrl::OnIdle(wxIdleEvent& event)
     if ( !richtext )
         return;
 
-    if ( !IsPopupShown() && wxWindow::FindFocus() != this )
+    if ( !IsPopupShown() && IsShownOnScreen() && wxWindow::FindFocus() != this )
     {
         wxString styleName =
             wxRichTextStyleListBox::GetStyleToShowInIdleTime(richtext, m_stylePopup->GetStyleType());