I use custom drag objects with drag images. Normal drag and drop (without self made drag images) works as expected but when I use a drag image it is added to the OS windows list which results in ugly on/off. Both Gtk2 and Qt show this behavior. Is it a bug?
The code is rather simple:
function TDragTest.GetDragImages: TDragImageList;
const
Size=20;
var
i:integer;
aBmp:TBitmap;
begin
FDragImages.Width:=Size; //FDragImages=TDragImageList created with <TDragObject>.Create
FDragImages.Height:=Size;
aBmp:=TBitmap.Create;
try
aBmp.Width:=Size;
aBmp.Height:=Size;
aBmp.Canvas.Brush.Color:=clRed;
aBmp.Canvas.FillRect(aBmp.Canvas.ClipRect);
i:=FDragImages.AddMasked(aBmp, clBtnFace);
finally
aBmp.Free;
end;
Result:=FDragImages;
Result.SetDragImage(i,Size+1,Size+1);
end;