コード例 #1
0
 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();
     }
   }
 }
コード例 #2
0
 void detachChild() {
   if (xembedLog.isLoggable(PlatformLogger.FINE))
     xembedLog.fine("Detaching child " + Long.toHexString(xembed.handle));
   /**
    * XEmbed specification: "The embedder can unmap the client and reparent the client window to
    * the root window. If the client receives an ReparentNotify event, it should check the parent
    * field of the XReparentEvent structure. If this is the root window of the window's screen,
    * then the protocol is finished and there is no further interaction. If it is a window other
    * than the root window, then the protocol continues with the new parent acting as the embedder
    * window."
    */
   XToolkit.awtLock();
   try {
     XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), xembed.handle);
     XlibWrapper.XReparentWindow(
         XToolkit.getDisplay(), xembed.handle, XToolkit.getDefaultRootWindow(), 0, 0);
   } finally {
     XToolkit.awtUnlock();
   }
   endDispatching();
   xembed.handle = 0;
 }