anchor.diff:    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;
  +
  +procedure TfpgX11Application.HandleDNDdrop(ATopLevelWindow: TfpgX11Window;
  +    const ASource: TWindow; const ATimestamp: x.TTime);
  +var
  +  Msg: TXEvent;
  +begin
  +  {$IFDEF DEBUG}
  +  writeln('XdndDrop event received!');
  +  {$ENDIF}
  +  XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp);
  +
  +  { send message to confirm drop will be accepted in specified rectangle }
  +  FillChar(Msg, SizeOf(Msg), 0);
  +  Msg.xany._type            := ClientMessage;
  +  Msg.xany.display          := FDisplay;
  +  Msg.xclient.window        := FSrcWinHandle; // source winhandle msg is going to
  +  Msg.xclient.message_type  := XdndFinished;
  +  Msg.xclient.format        := 32;
  +
  +  Msg.xclient.data.l[0] := ATopLevelWindow.FWinHandle;  // winhandle of target window
  +  Msg.xclient.data.l[1] := 1; // drop accepted - target can remove the data
  +  Msg.xclient.data.l[2] := FActionType; // this should be the action we accepted
  +
  +  XSendEvent(FDisplay, FSrcWinHandle, False, NoEventMask, @Msg);
  +  ResetDNDVariables;
   end;
   
   function TfpgX11Application.DoGetFontFaceList: TStringList;
  
positive.code:     if TfpgWidget(ATopLevelWindow).AcceptDrops then
        lAccept := 1;
  
    // query to see if we accept to be drop target
    XTranslateCoordinates(FDisplay, XDefaultRootWindow(FDisplay), ATopLevelWindow.WinHandle,
        x_root, y_root, @dx, @dy, @child);
  
    if child <> 0 then
    begin
  
negative.code:               if not blockmsg then
                  fpgPostMessage(nil, FindWindowByHandle(ev.xclient.window), FPGM_CLOSE);
               end;
            end
            { XDND protocol - XdndEnter }
            else if Assigned(w) and (ev.xclient.message_type = XdndEnter) then
            begin
              HandleDNDenter(w, ev.xclient.data.l[0], ev);
            end
            { XDND protocol - XdndPosition }
            else if Assigned(w) and (ev.xclient.message_type = XdndPosition) then
            begin
              HandleDNDposition(w,                            // top level window
                  ev.xclient.data.l[0],                       // Source window
                  (ev.xclient.data.l[2] shr 16) and $FFFF,    // x_root
                  ev.xclient.data.l[2] and $FFFF,             // y_root
                  ev.xclient.data.l[4],                       // action
                  ev.xclient.data.l[3]);                      // timestamp
            end
            { XDND protocol - XdndStatus }
            else if Assigned(w) and (ev.xclient.message_type = XdndStatus) then
            begin
              {$IFDEF DNDDEBUG}
              writeln('XdndStatus event received!');
              {$ENDIF}
            end
            { XDND protocol - XdndLeave }
            else if Assigned(w) and (ev.xclient.message_type = XdndLeave) then
            begin
              HandleDNDleave(w, ev.xclient.data.l[0]);
            end
            { XDND protocol - XdndDrop }
            else if Assigned(w) and (ev.xclient.message_type = XdndDrop) then
            begin
              HandleDNDdrop(w, ev.xclient.data.l[0], ev.xclient.data.l[2]);
            end
            { XDND protocol - XdndFinished }
            else if Assigned(w) and (ev.xclient.message_type = XdndFinished) then
            begin
              {$IFDEF DNDDEBUG}
              writeln('XdndFinished event received!');
              {$ENDIF}
            end;
          end;
  
      X.ConfigureNotify:
  