In Refresh(), allow for possibility that child is mapped and parent is not.

It turns out this can actually happen, and is apparently allowed by GTK.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2011-12-07 19:34:57 +00:00
parent e0e022b067
commit ffaaf1078e

View File

@@ -3568,10 +3568,9 @@ bool wxWindowGTK::ScrollPages(int pages)
void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground), void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
const wxRect *rect) const wxRect *rect)
{ {
if (m_widget == NULL || !gtk_widget_get_mapped(m_widget))
return;
if (m_wxwindow) if (m_wxwindow)
{
if (gtk_widget_get_mapped(m_wxwindow))
{ {
GdkWindow* window = gtk_widget_get_window(m_wxwindow); GdkWindow* window = gtk_widget_get_window(m_wxwindow);
if (rect) if (rect)
@@ -3584,7 +3583,10 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
else else
gdk_window_invalidate_rect(window, NULL, true); gdk_window_invalidate_rect(window, NULL, true);
} }
else }
else if (m_widget)
{
if (gtk_widget_get_mapped(m_widget))
{ {
if (rect) if (rect)
gtk_widget_queue_draw_area(m_widget, rect->x, rect->y, rect->width, rect->height); gtk_widget_queue_draw_area(m_widget, rect->x, rect->y, rect->width, rect->height);
@@ -3592,6 +3594,7 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
gtk_widget_queue_draw(m_widget); gtk_widget_queue_draw(m_widget);
} }
} }
}
void wxWindowGTK::Update() void wxWindowGTK::Update()
{ {