LCL, GTK2: Fix double click behavior when handler takes more than 250 milliseconds. Patche from Max Vlasov, issues #14001 and #19753

git-svn-id: trunk@31737 -
This commit is contained in:
juha 2011-07-18 15:15:11 +00:00
parent 00f5677d94
commit c48e840412
2 changed files with 4 additions and 4 deletions

View File

@ -1657,7 +1657,7 @@ var
function LastClickInTime: boolean; function LastClickInTime: boolean;
begin begin
Result := ((now - LastMouse.TheTime) <= ((1/86400)*(DblClickTime/1000))); Result:=(event^.time - LastMouse.eventTime) <= DblClickTime;
end; end;
function TestIfMultiClick: boolean; function TestIfMultiClick: boolean;
@ -1732,7 +1732,7 @@ var
DebugLn(' ClickCount=',dbgs(LastMouse.ClickCount)); DebugLn(' ClickCount=',dbgs(LastMouse.ClickCount));
{$ENDIF} {$ENDIF}
LastMouse.TheTime := Now; LastMouse.eventTime := event^.time;
LastMouse.Window := Event^.Window; LastMouse.Window := Event^.Window;
LastMouse.WindowPoint := EventXY; LastMouse.WindowPoint := EventXY;
LastMouse.Down := True; LastMouse.Down := True;

View File

@ -75,7 +75,7 @@ const
type type
TLastMouseClick = record TLastMouseClick = record
Down: boolean; Down: boolean;
TheTime: TDateTime; // last Down time eventTime: guint32; // last Down time
ClickCount: integer; ClickCount: integer;
Component: TComponent; Component: TComponent;
Window: PGdkWindow; Window: PGdkWindow;
@ -84,7 +84,7 @@ type
const const
EmptyLastMouseClick: TLastMouseClick = EmptyLastMouseClick: TLastMouseClick =
(Down: false; TheTime: -1; ClickCount: 0; Component: nil; (Down: false; eventTime: 0; ClickCount: 0; Component: nil;
Window: nil; WindowPoint: (X: 0; Y: 0)); Window: nil; WindowPoint: (X: 0; Y: 0));
var var