Gtk2: bugfix where csCaptureMouse cannot be disabled. issue #8178

git-svn-id: trunk@30152 -
This commit is contained in:
zeljko 2011-04-03 13:32:40 +00:00
parent 2c0ed6c9f9
commit 67aec0c9c4

View File

@ -1310,6 +1310,7 @@ const
var
DesignOnlySignal: boolean;
ShiftState: TShiftState;
ACtl: TWinControl;
begin
Result := CallBackDefaultReturn;
@ -1360,8 +1361,17 @@ begin
Result := CallBackDefaultReturn; // why not True if we want to stop it?
end;
DeliverMouseMoveMessage(Widget,Event,TWinControl(Data));
if TControl(Data).FCompStyle = csWinControl then
ACtl := TWinControl(Data);
if not (csCaptureMouse in ACtl.ControlStyle) and
([ssLeft,ssRight,ssMiddle]*ShiftState <> []) and
not (ACtl is TCustomForm) and not DragManager.IsDragging then
begin
if (Event^.x < 0) or (Event^.y < 0) or
(Event^.x > ACtl.Width) or (Event^.y > ACtl.Height) then
Exit(True);
end;
DeliverMouseMoveMessage(Widget,Event, ACtl);
if ACtl.FCompStyle = csWinControl then
Result := True; // stop signal
end;