X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c958d025fa18c6446eb22e06b745317c48e19c53..249b31b53b6a91bbd2c9f4e2b56355753f6525c9:/src/gtk1/window.cpp diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 90d84b4683..dbc991b9b2 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3982,9 +3982,7 @@ void wxWindowGTK::GtkSendPaintEvents() if (GetThemeEnabled() && (GetBackgroundStyle() == wxBG_STYLE_SYSTEM)) { // find ancestor from which to steal background - wxWindow *parent = IsTopLevel() ? this : GetParent(); - while (parent && !parent->IsTopLevel()) - parent = parent->GetParent(); + wxWindow *parent = wxGetTopLevelParent((wxWindow *)this); if (!parent) parent = (wxWindow*)this;