]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/window.cpp
Implement wxComboBox::Popup() and Dismiss() for wxOSX/Cocoa.
[wxWidgets.git] / src / gtk / window.cpp
index 74ba1ce2b7b6995d04a8da4f7cb372bea22b9d80..2b2ead040554a16ff8fc2b0cf7cf1b35dbc8d945 100644 (file)
@@ -3568,28 +3568,31 @@ bool wxWindowGTK::ScrollPages(int pages)
 void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground),
                           const wxRect *rect)
 {
-    if (m_widget == NULL || !gtk_widget_get_mapped(m_widget))
-        return;
-
     if (m_wxwindow)
     {
-        GdkWindow* window = gtk_widget_get_window(m_wxwindow);
-        if (rect)
+        if (gtk_widget_get_mapped(m_wxwindow))
         {
-            GdkRectangle r = { rect->x, rect->y, rect->width, rect->height };
-            if (GetLayoutDirection() == wxLayout_RightToLeft)
-                r.x = gdk_window_get_width(window) - r.x - rect->width;
-            gdk_window_invalidate_rect(window, &r, true);
+            GdkWindow* window = gtk_widget_get_window(m_wxwindow);
+            if (rect)
+            {
+                GdkRectangle r = { rect->x, rect->y, rect->width, rect->height };
+                if (GetLayoutDirection() == wxLayout_RightToLeft)
+                    r.x = gdk_window_get_width(window) - r.x - rect->width;
+                gdk_window_invalidate_rect(window, &r, true);
+            }
+            else
+                gdk_window_invalidate_rect(window, NULL, true);
         }
-        else
-            gdk_window_invalidate_rect(window, NULL, true);
     }
-    else
+    else if (m_widget)
     {
-        if (rect)
-            gtk_widget_queue_draw_area(m_widget, rect->x, rect->y, rect->width, rect->height);
-        else
-            gtk_widget_queue_draw(m_widget);
+        if (gtk_widget_get_mapped(m_widget))
+        {
+            if (rect)
+                gtk_widget_queue_draw_area(m_widget, rect->x, rect->y, rect->width, rect->height);
+            else
+                gtk_widget_queue_draw(m_widget);
+        }
     }
 }