#endif
 
-// _WX_COLOUR_H_
\ No newline at end of file
+// _WX_COLOUR_H_
+
 
     // common part of all ctors
     void Init();
 
+    // For implementation purposes - sometimes decorations make the client area
+    // smaller
+    virtual wxPoint GetClientAreaOrigin() const;
+
+    virtual void DoGetClientSize( int *width, int *height ) const;
+    virtual void DoSetClientSize(int width, int height);
+    
     // is the frame currently iconized?
     bool m_iconized;
 
 
         // the menubar is positioned above the client size, hence the negative
         // y coord
         wxCoord heightMbar = m_frameMenuBar->GetSize().y;
+
         m_frameMenuBar->SetSize(0, 
 #ifdef __WXPM__         // FIXME -- remove this, make wxOS2/Univ behave as
                  //          the rest of the world!!!
 
 
         CalcBoundingBox(x1, y1);
         CalcBoundingBox(x2, y2);
+
+       wxLogDebug("Drawing line at %d, %d -> %d, %d", XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2) );
     }
 }
 
 
     CalcBoundingBox( x, y );
     CalcBoundingBox( x + width, y + height );
+    wxLogDebug("Drawing rectangle at %d, %d (%dx%d)", x, y, width, height);
 }
 
 void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
        {
         XDrawString( (Display*) m_display, (Window) m_window, 
             (GC) m_textGC, x, y, text.c_str(), text.Len() );
+       wxLogDebug("Drawing text %s at %d, %d", text.c_str(), x, y);
        }
 
 #if 0
 
     #include "wx/log.h"
     #include "wx/intl.h"
     #include "wx/frame.h"
+    #include "wx/menu.h"
+    #include "wx/statusbr.h"
 #endif //WX_PRECOMP
 
 #include "wx/x11/private.h"
 
-
 bool wxMWMIsRunning(Window w);
 
 // ----------------------------------------------------------------------------
     return (ret == Success);
 }
     
+// For implementation purposes - sometimes decorations make the client area
+// smaller
+wxPoint wxTopLevelWindowX11::GetClientAreaOrigin() const
+{
+    if (this->IsKindOf(CLASSINFO(wxFrame)))
+    {
+       wxFrame* frame = (wxFrame*) this;
+       if (frame->GetMenuBar())
+           return wxPoint(0, frame->GetMenuBar()->GetSize().y);
+    }
+    return wxPoint(0, 0);
+}
+
+void wxTopLevelWindowX11::DoGetClientSize( int *width, int *height ) const
+{
+    wxWindowX11::DoGetClientSize(width, height);
+    if (this->IsKindOf(CLASSINFO(wxFrame)))
+    {
+       wxFrame* frame = (wxFrame*) this;
+       if (frame->GetMenuBar())
+           (*height) -= frame->GetMenuBar()->GetSize().y;
+       if (frame->GetStatusBar())
+           (*height) -= frame->GetStatusBar()->GetSize().y;
+    }
+}
+
+void wxTopLevelWindowX11::DoSetClientSize(int width, int height)
+{
+    // TODO - take menubar and status line into account
+    wxWindowX11::DoSetClientSize(width, height);
+#if 0
+    if (!GetMainWindow())
+        return;
+
+    XWindowChanges windowChanges;
+    int valueMask = 0;
+
+    if (width != -1)
+    {
+        windowChanges.width = width ;
+        valueMask |= CWWidth;
+    }
+    if (height != -1)
+    {
+        windowChanges.height = height ;
+        valueMask |= CWHeight;
+    }
+    XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
+        valueMask, & windowChanges);
+#endif
+}
 
 
     if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     {
+       int yy = 0;
+        AdjustForParentClientOrigin( x, yy, sizeFlags);
         windowChanges.x = x;
         valueMask |= CWX;
     }
     if (y != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     {
+       int xx = 0;
+        AdjustForParentClientOrigin( xx, y, sizeFlags);
         windowChanges.y = y;
         valueMask |= CWY;
     }
         windowChanges.height = height /* -m_borderSize*2*/;
         valueMask |= CWHeight;
     }
-    AdjustForParentClientOrigin( x, y, sizeFlags);
 
     XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
         valueMask, & windowChanges);