]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toplevel.cpp
make it possible to create wxWindowDC for a hidden window
[wxWidgets.git] / src / gtk / toplevel.cpp
index 278629e5fa4a30c4804afd2e6b02d5e95e8ee774..614a4dce0af589ef047dc9a46706445c01da08e1 100644 (file)
@@ -915,18 +915,16 @@ void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const
 
     if (height)
     {
-        *height = m_height;
-    
-        // mini edge
-        *height -= m_miniEdge*2 + m_miniTitle;
+        *height = m_height - 2 * m_miniEdge + m_miniTitle;
+        if (*height < 0)
+            *height = 0;
     }
     if (width)
     {
-        *width = m_width;
-    
-        *width -= m_miniEdge*2;
+        *width = m_width - 2 * m_miniEdge;
+        if (*width < 0)
+            *width = 0;
     }
-    
 }
 
 void wxTopLevelWindowGTK::DoSetClientSize( int width, int height )
@@ -1021,6 +1019,10 @@ void wxTopLevelWindowGTK::GtkOnSize()
         int client_y = m_miniEdge + m_miniTitle;
         int client_w = m_width - 2*m_miniEdge;
         int client_h = m_height - 2*m_miniEdge - m_miniTitle;
+        if (client_w < 0)
+            client_w = 0;
+        if (client_h < 0)
+            client_h = 0;
 
         gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
                               m_wxwindow,