LCL-Gtk2: Fixed coordinates in MouseMove/MouseDown events (regression after e916d8bc16).

Patch by Alexander (Rouse_) Bagel, issue #40726.
This commit is contained in:
Maxim Ganetsky 2024-01-25 19:08:54 +03:00
parent 6a1aea3ed2
commit ac1d49467b

View File

@ -4654,6 +4654,7 @@ function GetWidgetClientOrigin(TheWidget: PGtkWidget): TPoint;
var
ClientWidget: PGtkWidget;
WidgetInfo: PWidgetInfo;
ClientWindow: PGdkWindow;
LCLObject: TObject;
begin
@ -4669,7 +4670,11 @@ begin
LCLObject := GetLCLObject(ClientWidget);
if (LCLObject is TWinControl) and (TWinControl(LCLObject).Parent = nil)
and not (csDesigning in TWinControl(LCLObject).ComponentState) then
Exit(TWinControl(LCLObject).BoundsRect.TopLeft);
begin
WidgetInfo := GetWidgetInfo(ClientWidget);
if Assigned(WidgetInfo) and (WidgetInfo^.FormBorderStyle = 0) then
Exit(TWinControl(LCLObject).BoundsRect.TopLeft);
end;
end;
{$IFDEF DebugGDK}
BeginGDKErrorTrap;