anchor.diff:                  ClosePopups;
                 end;
               end;
  +          end
  +          else
  +          begin
  +            if Assigned(Drag) then    // button released
  +            begin
  +              Drag.SendDNDDrop;
  +              { TODO: Start timeout in case XdndFinished is not received, so we can free Drag }
  +//              writeln('Freeing Drag Object');
  +//              FreeAndNil(FDrag);
  +            end;
             end;
   
             w := FindWindowByHandle(ev.xbutton.window); // restore w
  
positive.code:           until not XCheckTypedWindowEvent(display, ev.xmotion.window, X.MotionNotify, @ev);
            w := FindWindowByHandle(ev.xmotion.window);
            if not Assigned(w) then
              ReportLostWindow(ev);
            if xapplication.TopModalForm <> nil then
            begin
              ew := TfpgX11Window(WidgetParentForm(TfpgWidget(w)));
              if (ew <> nil) and (xapplication.TopModalForm <> ew) and (waUnblockableMessages in ew.WindowAttributes = False) then
                blockmsg := true;
            end;
            if not blockmsg then
            begin
              msgp.mouse.x          := ev.xmotion.x;
              msgp.mouse.y          := ev.xmotion.y;
              msgp.mouse.Buttons    := (ev.xmotion.state and $FF00) shr 8;
              msgp.mouse.shiftstate := ConvertShiftState(ev.xmotion.state);
              fpgPostMessage(nil, FindWindowByHandle(ev.xmotion.window), FPGM_MOUSEMOVE, msgp);
            end;
          end;
  
  
negative.code: var
    Msg: TXEvent;
  begin
    {$IFDEF DNDDEBUG}
    writeln('XdndDrop event received!');
    {$ENDIF}
    XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp);
  