]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't inherit background from parent if we're top-level
authorJulian Smart <julian@anthemion.co.uk>
Mon, 21 Feb 2005 11:41:59 +0000 (11:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 21 Feb 2005 11:41:59 +0000 (11:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp
src/gtk1/window.cpp

index f828018064629816014d3252f9b9d6ac6bcfc345..a55d32a3ad1cecaf558d0d4a0b14b472088ba483 100644 (file)
@@ -3977,10 +3977,10 @@ void wxWindowGTK::GtkSendPaintEvents()
     // widget to draw on
     GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
 
     // widget to draw on
     GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
 
-    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM) && !IsTopLevel())
+    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM))
     {
         // find ancestor from which to steal background
     {
         // find ancestor from which to steal background
-        wxWindow *parent = GetParent();
+        wxWindow *parent = IsTopLevel() ? this : GetParent();
         while (parent && !parent->IsTopLevel())
             parent = parent->GetParent();
         if (!parent)
         while (parent && !parent->IsTopLevel())
             parent = parent->GetParent();
         if (!parent)
index f828018064629816014d3252f9b9d6ac6bcfc345..a55d32a3ad1cecaf558d0d4a0b14b472088ba483 100644 (file)
@@ -3977,10 +3977,10 @@ void wxWindowGTK::GtkSendPaintEvents()
     // widget to draw on
     GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
 
     // widget to draw on
     GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
 
-    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM) && !IsTopLevel())
+    if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM))
     {
         // find ancestor from which to steal background
     {
         // find ancestor from which to steal background
-        wxWindow *parent = GetParent();
+        wxWindow *parent = IsTopLevel() ? this : GetParent();
         while (parent && !parent->IsTopLevel())
             parent = parent->GetParent();
         if (!parent)
         while (parent && !parent->IsTopLevel())
             parent = parent->GetParent();
         if (!parent)