fi
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
-    cat >> confdefs.h <<\EOF
+    if test "$wxUSE_X11" = 1; then
+        echo "configure: warning: Clipboard not yet supported under X11... disabled" 1>&2
+        wxUSE_CLIPBOARD=no
+    fi
+
+    if test "$wxUSE_CLIPBOARD" = "yes"; then
+        cat >> confdefs.h <<\EOF
 #define wxUSE_CLIPBOARD 1
 EOF
 
 
-        cat >> confdefs.h <<\EOF
+                cat >> confdefs.h <<\EOF
 #define wxUSE_DATAOBJ 1
 EOF
 
+    fi
 fi
 
 if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
             if test "$wxUSE_UNIVERSAL" = "yes"; then
                 echo "configure: warning: wxTooltip not supported yet in wxUNIVERSAL... disabled" 1>&2
             else
-                cat >> confdefs.h <<\EOF
+                if test "$wxUSE_X11" = "1"; then
+                    echo "configure: warning: wxTooltip not supported yet under X11... disabled" 1>&2
+                else
+                    cat >> confdefs.h <<\EOF
 #define wxUSE_TOOLTIPS 1
 EOF
 
+                fi
             fi
         fi
     fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:20362: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:20373: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 
 fi
 
 if test "$wxUSE_CLIPBOARD" = "yes"; then
-    AC_DEFINE(wxUSE_CLIPBOARD)
+    if test "$wxUSE_X11" = 1; then
+        AC_MSG_WARN([Clipboard not yet supported under X11... disabled])
+        wxUSE_CLIPBOARD=no
+    fi
+
+    if test "$wxUSE_CLIPBOARD" = "yes"; then
+        AC_DEFINE(wxUSE_CLIPBOARD)
 
-    dnl required by clipboard code in configuration check
-    AC_DEFINE(wxUSE_DATAOBJ)
+        dnl required by clipboard code in configuration check
+        AC_DEFINE(wxUSE_DATAOBJ)
+    fi
 fi
 
 if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
             if test "$wxUSE_UNIVERSAL" = "yes"; then
                 AC_MSG_WARN([wxTooltip not supported yet in wxUNIVERSAL... disabled])
             else
-                AC_DEFINE(wxUSE_TOOLTIPS)
+                if test "$wxUSE_X11" = "1"; then
+                    AC_MSG_WARN([wxTooltip not supported yet under X11... disabled])
+                else
+                    AC_DEFINE(wxUSE_TOOLTIPS)
+                fi
             fi
         fi
     fi
 
     int h = size.GetHeight();
     int x = size.GetX();
     int y = size.GetY();
-    int h = size.GetHeight();
-    if (w == -1) w = 10;
-    if (h == -1) h = 10;
+    if (w == -1) w = 20;
+    if (h == -1) h = 20;
     if (x == -1) x = 0;
     if (y == -1) y = 0;
 
-    int innerWidth = w - 2*m_borderSize;
-    int innerHeight = h - 2*m_borderSize;
-
     int screen = DefaultScreen(wxGlobalDisplay());
 
     Window parentWindow;
     else
         parentWindow = RootWindow(wxGlobalDisplay(), screen);
 
-    Widget window = XCreateSimpleWindow(wxGlobalDisplay(), 
-        x, y, innerWidth, innerHeight, borderWidth,
+    Window window = XCreateSimpleWindow(wxGlobalDisplay(), parentWindow,
+        x, y, w, h, m_borderSize,
         m_backgroundColour.AllocColour(wxGlobalDisplay()),
         m_foregroundColour.AllocColour(wxGlobalDisplay()));
 
         KeymapStateMask | FocusChangeMask | ColormapChangeMask | StructureNotifyMask |
         PropertyChangeMask);
 
-    m_mainWindow = (WXWindow) window;
-
     wxAddWindowToTable(window, (wxWindow*) this);
 
     // If a subwindow, show.
-    if (parent && !parent->IsKindOf(CLASSINFO(wxTopLevelWindowX11)) && parent->IsShown())
+//    if (parent && !parent->IsKindOf(CLASSINFO(wxTopLevelWindowX11)) && parent->IsShown())
     {
         m_isShown = TRUE;
         XMapWindow(wxGlobalDisplay(), window);
         XSelectInput(wxGlobalDisplay(), (Window) GetMainWindow(),
             NoEventMask);
         wxDeleteWindowFromTable((Window) GetMainWindow());
-        XDestroyWindow((Window) GetMainWindow());
+        XDestroyWindow(wxGlobalDisplay(), (Window) GetMainWindow());
         SetMainWindow((WXWindow) NULL);
     }
 }
 
 void wxWindowX11::SetFocus()
 {
+#if 0
     Window wMain = (Window) GetMainWidget();
     if (wMain)
     {
         wmhints.input = True;
         XSetWMHints(wxGlobalDisplay(), wMain, &wmhints)
     }
+#endif
 }
 
 // Get the window with the focus
     if ( !m_winCaptured )
         return;
 
-    Widget wMain = (Widget)GetMainWidget();
+    Window wMain = (Window)GetMainWindow();
 
     // TODO: should we also call XUngrabButton, XUngrabKeyboard?
     if ( wMain )
         windowChanges.height = height - m_borderSize*2;
         valueMask |= CWHeight;
     }
-    AdjustForParentClientOrigin(valueMask.x, valueMask.y, sizeFlags);
+    AdjustForParentClientOrigin( x, y, sizeFlags);
 
     XConfigureWindow(wxGlobalDisplay(), (Window) GetMainWindow(),
         valueMask, & windowChanges);
         sizeHints.height_inc = incH;
     }
 
-    XSetWMNormalHints(wxGlobalDisplay(), (Window) GetMainWindow(), & sizeHints)
+    XSetWMNormalHints(wxGlobalDisplay(), (Window) GetMainWindow(), & sizeHints);
 }
 
 void wxWindowX11::DoMoveWindow(int x, int y, int width, int height)