anchor.diff:    end;
     if count > 3 then
       XFree(xdndtypes);
  -
  -  for i := 0 to FDNDTypeList.Count-1 do
  -  begin
  -    { TODO: Somehow we must be told what is our preferred mime type }
  -    { This list must be from most specific to least specific }
  -    if TDNDSrcType(FDNDTypeList[i]).Name = 'text/plain' then
  -      FDNDDataType := TDNDSrcType(FDNDTypeList[i]).ID
  -    else if TDNDSrcType(FDNDTypeList[i]).Name = 'TEXT' then
  -      FDNDDataType := TDNDSrcType(FDNDTypeList[i]).ID
  -    else if TDNDSrcType(FDNDTypeList[i]).Name = 'STRING' then
  -      FDNDDataType := TDNDSrcType(FDNDTypeList[i]).ID;
  -    if FDNDDataType <> 0 then
  -      break;
  -  end;
   end;
   
   procedure TfpgX11Application.HandleDNDleave(ATopLevelWindow: TfpgX11Window;
  
positive.code:   Msg.xclient.message_type  := XdndStatus;
    Msg.xclient.format        := 32;
  
  
    Msg.xclient.data.l[0] := ATopLevelWindow.WinHandle;  // always top-level window
    Msg.xclient.data.l[1] := 0;
    if (FDNDDataType <> None) and (FActionType = XdndActionCopy) and (lAccept = 1) then  // we only accept copy action for now
      Msg.xclient.data.l[1] := 1; // 0 xor (1 shl 0); // 0-bit set so we accept drop
    {$IFDEF DNDDEBUG}
    if FDNDDataType = None then
      writeln('No suitable data type found, so we refuse drop');
    if FActionType <> XdndActionCopy then
      writeln('No suitable action found, so we refuse drop');
    {$ENDIF}
    Msg.xclient.data.l[2] := 0; // (Left shl 16) or Top;  // x & y co-ordinates
    Msg.xclient.data.l[3] := 0; // (Width shl 16) or Height; // w & h co-ordinates
    Msg.xclient.data.l[4] := FActionType; // this should be the action we accept
  
    XSendEvent(FDisplay, FSrcWinHandle, False, NoEventMask, @Msg);
  end;
  
negative.code:   {$ENDIF}
  
    if child <> 0 then
      w := FindWindowByHandle(child)
    else
      w := ATopLevelWindow;
  
    if Assigned(w) then
    begin
      lTargetWinHandle := w.WinHandle;
      {$IFDEF DNDDEBUG}
      writeln('dragging over window: ', w.Name);
      {$ENDIF}
      if w is TfpgWidget then      // TODO: We could use Interfaces here eg: IDragDropEnabled
      begin
        wg := TfpgWidget(w);
        if FLastDropTarget <> lTargetWinHandle then
        begin
          fillchar(msgp, sizeof(msgp), 0);
          fpgPostMessage(nil, FindWindowByHandle(FLastDropTarget), FPGM_DROPEXIT, msgp);
        end;
        FLastDropTarget := lTargetWinHandle;
        if wg.AcceptDrops then
        begin
          if Assigned(wg.OnDragEnter) then
          begin
            lDropAction := GetDropActionFromAtom(AAction);
            lMimeList := TStringList.Create;
            for i := 0 to FDNDTypeList.Count-1 do
              lMimeList.Add(TDNDSrcType(FDNDTypeList[i]).Name);
            { TODO: We need to populate the Source parameter. }
            wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept);
            lMimeList.Free;
            FActionType := GetAtomFromDropAction(lDropAction);
          end;
  
          if lAccept then
          begin
            fillchar(msgp, sizeof(msgp), 0);
            msgp.mouse.x := dx;
            msgp.mouse.y := dy;
  