gtk2 intf: clean up

git-svn-id: trunk@21201 -
This commit is contained in:
mattias 2009-08-12 15:24:07 +00:00
parent 16af7e11b4
commit 365837b53b

View File

@ -1527,10 +1527,12 @@ function gtkMouseBtnPress(widget: PGtkWidget; event: pgdkEventButton;
var
DesignOnlySignal: boolean;
AWinControl: TWinControl;
{$IFDEF GTK1}
CaptureWidget: PGtkWidget;
EventXY: TPoint;
MappedXY: TPoint;
AWinControl: TWinControl;
{$ENDIF}
begin
Result := CallBackDefaultReturn;
MousePositionValid := False;
@ -1564,13 +1566,13 @@ begin
if DesignOnlySignal then exit;
if not ControlGetsMouseDownBefore(TControl(Data), Widget) then Exit;
CaptureWidget := PGtkWidget(AWinControl.Handle);
if Event^.button = 1 then
begin
EventXY := Point(TruncToInt(Event^.X), TruncToInt(Event^.Y));
MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY, CaptureWidget);
{$IFDEF Gtk1}
// gtk2: the LCL will capture itself if DragMode=dmAutomatic
CaptureWidget := PGtkWidget(AWinControl.Handle);
EventXY := Point(TruncToInt(Event^.X), TruncToInt(Event^.Y));
MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY, CaptureWidget);
SetCaptureControl(AWinControl, MappedXY);
{$ENDIF}
//CaptureMouseForWidget(CaptureWidget,mctGTKIntf);