From: Robert Roebling <robert@roebling.de>
Date: Wed, 17 Oct 2007 09:43:19 +0000 (+0000)
Subject: Correct focus rect to not appear in unfocussed controls (currently doesn't appear... 
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/001f0f8273679e2ad85c8b7246db0f4d95db3ebb

Correct focus rect to not appear in unfocussed controls (currently doesn't appear at all under XP

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/include/wx/dataview.h b/include/wx/dataview.h
index 4af433f8f3..ff88b73783 100644
--- a/include/wx/dataview.h
+++ b/include/wx/dataview.h
@@ -26,7 +26,7 @@
 
 #if defined(__WXGTK20__)
     // for testing
-    #define wxUSE_GENERICDATAVIEWCTRL 1
+    // #define wxUSE_GENERICDATAVIEWCTRL 1
 #elif defined(__WXMAC__)
 #else
     #define wxUSE_GENERICDATAVIEWCTRL 1
diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp
index dfc95dbb3f..f91f29dc78 100644
--- a/src/generic/datavgen.cpp
+++ b/src/generic/datavgen.cpp
@@ -2351,6 +2351,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
                     x, item_last * m_lineHeight);
     }
 
+    bool has_focus = (FindFocus() == this);
     // redraw the background for the items which are selected/current
     for (unsigned int item = item_start; item < item_last; item++)
     {
@@ -2358,7 +2359,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
         if (selected || item == m_currentRow)
         {
             int flags = selected ? (int)wxCONTROL_SELECTED : 0;
-            if (item == m_currentRow)
+            if ((item == m_currentRow) && has_focus)
                 flags |= wxCONTROL_CURRENT;
             if (m_hasFocus)
                 flags |= wxCONTROL_FOCUSED;