mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-15 19:26:03 +08:00
Try to fix AV on tab closing, this time by avoiding calls to TControl.ClientToScreen respectively ScreenToClient, which I both suspect to be buggy. Fixes issue #1935.
This commit is contained in:
@ -8955,7 +8955,7 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.CloseButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure TMainForm.CloseButtonOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
var
|
var
|
||||||
aPoint: TPoint;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
// Click on "Close" button of Query tab
|
// Click on "Close" button of Query tab
|
||||||
if Button <> mbLeft then
|
if Button <> mbLeft then
|
||||||
@ -8964,8 +8964,12 @@ begin
|
|||||||
// here, we must check if also the MouseDown event was fired on this particular button. See issue #1469.
|
// here, we must check if also the MouseDown event was fired on this particular button. See issue #1469.
|
||||||
if (Sender <> FLastMouseDownCloseButton) then
|
if (Sender <> FLastMouseDownCloseButton) then
|
||||||
Exit;
|
Exit;
|
||||||
aPoint := PageControlMain.ScreenToClient((Sender as TSpeedButton).ClientToScreen(Point(X,Y)));
|
for i:=0 to QueryTabs.Count-1 do begin
|
||||||
CloseQueryTab(GetMainTabAt(aPoint.X, aPoint.Y));
|
if QueryTabs[i].CloseButton = Sender then begin
|
||||||
|
CloseQueryTab(QueryTabs[i].TabSheet.PageIndex);
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user