// don't use getLocationOnScreen() inherited from XDecoratedPeer
 public Point getLocationOnScreen() {
   XToolkit.awtLock();
   try {
     return toGlobal(0, 0);
   } finally {
     XToolkit.awtUnlock();
   }
 }
  public void synthesizeFocusInOut(boolean doFocus) {
    XFocusChangeEvent xev = new XFocusChangeEvent();

    XToolkit.awtLock();
    try {
      xev.set_type(doFocus ? FocusIn : FocusOut);
      xev.set_window(getFocusProxy().getWindow());
      xev.set_mode(NotifyNormal);
      XlibWrapper.XSendEvent(
          XToolkit.getDisplay(), getFocusProxy().getWindow(), false, NoEventMask, xev.pData);
    } finally {
      XToolkit.awtUnlock();
      xev.dispose();
    }
  }
 void postInit(XCreateWindowParams params) {
   super.postInit(params);
   if (embedder != null) {
     // install X11 event dispatcher
     embedder.setClient(this);
     // reparent to XEmbed server
     embedder.install();
   } else if (getParentWindowHandle() != 0) {
     XToolkit.awtLock();
     try {
       XlibWrapper.XReparentWindow(
           XToolkit.getDisplay(), getWindow(), getParentWindowHandle(), 0, 0);
     } finally {
       XToolkit.awtUnlock();
     }
   }
 }
  public Rectangle getBoundsPrivate() {
    int x = 0, y = 0;
    int w = 0, h = 0;
    XWindowAttributes attr = new XWindowAttributes();

    XToolkit.awtLock();
    try {
      XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(), getWindow(), attr.pData);
      x = attr.get_x();
      y = attr.get_y();
      w = attr.get_width();
      h = attr.get_height();
    } finally {
      XToolkit.awtUnlock();
    }
    attr.dispose();

    return new Rectangle(x, y, w, h);
  }