Automatic Drack/Dock flashes a huge rectangle to screen-pos (0,0)
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
When setting a component to DragMode=automatic and then starting to drag it => a rectangle (dock/drag type rect) will be drawn (for a split second only) from the component top/left to the screens top/left.
Additional information:
C:\lazarus_latest\lcl\include\dragobject.inc line 116
FDockRect.BottomRight is never initialized => it will be 0/0 => the top/left of the screen.
procedure TDragDockObject.InitDock(APosition: TPoint);
begin
DragPos := APosition; //should have been done before
Control.CalculateDockSizes;
// mouse click offset from control TopLeft in screen coordinates
FDockRect.TopLeft := Control.ClientToScreen(Point(0, 0));
if Control.Width > 0 then
FDockOffset.x := Round((APosition.x - FDockRect.Left) / Control.Width * Control.UndockWidth)
else
FDockOffset.X := 0;
if Control.Height > 0 then
FDockOffset.Y := Round((APosition.y - FDockRect.Top) / Control.Height * Control.UndockHeight)
else
FDockOffset.Y := 0;
FEraseDockRect := Rect(MaxInt, 0, MaxInt, 0);
end;
--------------------
C:\lazarus_latest\lcl\include\dragmanager.inc
line 564
The above is being called from here.
procedure TDragManagerDefault.DragStart(AControl: TControl; AImmediate: Boolean; AThreshold: Integer);
//Start a drag operation
begin
if FPerformer = nil then
begin
if AThreshold >= 0 then
FThresholdValue := AThreshold
else
FThresholdValue := DragThreshold;
FWaitForTreshold := not AImmediate;
GetCursorPos(FStartPosition);
case AControl.DragKind of
dkDrag: FPerformer := TDragPerformer.Create(Self, AControl);
dkDock: FPerformer := TDockPerformer.Create(Self, AControl);
end;
if AImmediate then
begin
//
// DragStrart paint to Bottom/Righ = 0/0
//
FPerformer.DragStarted(FStartPosition);
DragMove(FStartPosition);
end;
end;
end;
Dragmove is probably correcting it. Not tested
Mantis conversion info:
- Mantis ID: 15040
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 22688 (#28dc4ada)
- Target version: 1.0.0
- LazTarget: 1.0