Example #1
0
  void initDispatching() {
    if (xembedLog.isLoggable(PlatformLogger.FINE))
      xembedLog.fine("Init embedding for " + Long.toHexString(xembed.handle));
    XToolkit.awtLock();
    try {
      XToolkit.addEventDispatcher(xembed.handle, xembed);
      XlibWrapper.XSelectInput(
          XToolkit.getDisplay(),
          xembed.handle,
          XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);

      XDropTargetRegistry.getRegistry().registerXEmbedClient(getWindow(), xembed.handle);
    } finally {
      XToolkit.awtUnlock();
    }
    xembed.processXEmbedInfo();

    notifyChildEmbedded();
  }
Example #2
0
  protected void registerClipboardViewerChecked() {
    // for XConvertSelection() to be called for the first time in getTargetsDelayed()
    isSelectionNotifyProcessed = true;

    boolean mustSchedule = false;
    synchronized (XClipboard.classLock) {
      if (targetsAtom2Clipboard == null) {
        targetsAtom2Clipboard = new HashMap<Long, XClipboard>(2);
      }
      mustSchedule = targetsAtom2Clipboard.isEmpty();
      targetsAtom2Clipboard.put(getTargetsPropertyAtom().getAtom(), this);
      if (mustSchedule) {
        XToolkit.addEventDispatcher(
            XWindow.getXAWTRootWindow().getWindow(), new SelectionNotifyHandler());
      }
    }
    if (mustSchedule) {
      XToolkit.schedule(new CheckChangeTimerTask(), XClipboard.getPollInterval());
    }
  }