anchor.diff:    {$IFDEF DNDDEBUG}
     writeln('XdndDrop event received!');
     {$ENDIF}
  +  { TODO: Must XConvertSelection always be called? }
     XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp);
   
     { send message to confirm drop will be accepted in specified rectangle }
  
positive.code:       Result := ARoot;
        exit;
      end;
  //     writeln('Query Tree');
      if XQueryTree(xapplication.Display, ARoot, @r, @p, @children, @numch) <> 0 then
      begin
        if (numch > 0) and (children <> nil) then
        begin
          r := None;
          { upon return from XQueryTree, children are listed in the current
            stacking order, from bottom-most (first) to top-most (last) }
          for i := numch-1 downto 0 do
          begin
            r := FindWindow(children^[i], x - wattr.x, y - wattr.y);
            if r <> None then
  
negative.code:   Result := actualtype <> None;
  end;
  
  { find toplevel window that contains mouse co-ordinates x, y (co-ordinates are
    from root window) }
  function FindWindow(ARoot: TWindow; const x, y: cint): TWindow;
  var
    wattr: TXWindowAttributes;
    r, p: TWindow;
    children: PWindowArray = nil;
    numchildren: cuint = 0;
    i: integer;
  begin
    XGetWindowAttributes(xapplication.Display, ARoot, @wattr);
    if (wattr.map_state <> IsUnmapped) and
        ((x >= wattr.x) and (x < (wattr.x + wattr.width))) and
  