mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Show session manager with a visible main form in the background. Should prevent HeidiSQL from stealing focus in OnShow, or wherever that happens. See http://www.heidisql.com/forum.php?t=14133
This commit is contained in:
@ -71,7 +71,6 @@ begin
|
||||
Application.UpdateFormatSettings := False;
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.OnMessage := Mainform.OnMessageHandler;
|
||||
MainForm.AfterFormCreate;
|
||||
Application.OnDeactivate := MainForm.ApplicationDeActivate;
|
||||
Application.MainFormOnTaskBar := True;
|
||||
Application.Run;
|
||||
|
@ -9756,6 +9756,7 @@ object MainForm: TMainForm
|
||||
end
|
||||
object ApplicationEvents1: TApplicationEvents
|
||||
OnDeactivate = ApplicationEvents1Deactivate
|
||||
OnIdle = ApplicationEvents1Idle
|
||||
Left = 504
|
||||
Top = 152
|
||||
end
|
||||
|
@ -584,7 +584,7 @@ type
|
||||
procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure AfterFormCreate;
|
||||
procedure AfterFormShow;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormResize(Sender: TObject);
|
||||
procedure actUserManagerExecute(Sender: TObject);
|
||||
@ -921,6 +921,7 @@ type
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure lblMenuMouseEnter(Sender: TObject);
|
||||
procedure lblMenuMouseLeave(Sender: TObject);
|
||||
procedure ApplicationEvents1Idle(Sender: TObject; var Done: Boolean);
|
||||
private
|
||||
// Executable file details
|
||||
FAppVerMajor: Integer;
|
||||
@ -929,6 +930,7 @@ type
|
||||
FAppVerRevision: Integer;
|
||||
FAppVersion: String;
|
||||
|
||||
FAfterFormShowFinished: Boolean;
|
||||
FLastHintMousepos: TPoint;
|
||||
FLastHintControlIndex: Integer;
|
||||
FDelimiter: String;
|
||||
@ -1415,6 +1417,7 @@ var
|
||||
CoolBand: TCoolBand;
|
||||
begin
|
||||
caption := APPNAME;
|
||||
FAfterFormShowFinished := False;
|
||||
|
||||
// First time translation via dxgettext.
|
||||
// Issue #3064: Ignore TFont, so "Default" on mainform for WinXP users does not get broken.
|
||||
@ -1718,7 +1721,7 @@ end;
|
||||
{**
|
||||
Check for connection parameters on commandline or show connections form.
|
||||
}
|
||||
procedure TMainForm.AfterFormCreate;
|
||||
procedure TMainForm.AfterFormShow;
|
||||
var
|
||||
LastSessions, FileNames: TStringlist;
|
||||
Connection: TDBConnection;
|
||||
@ -11285,6 +11288,18 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TMainForm.ApplicationEvents1Idle(Sender: TObject; var Done: Boolean);
|
||||
begin
|
||||
// Show up session manager in first idle time. MainForm is visible at this point.
|
||||
// See http://www.heidisql.com/forum.php?t=14133
|
||||
if not FAfterFormShowFinished then begin
|
||||
FAfterFormShowFinished := False;
|
||||
AfterFormShow;
|
||||
Done := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TMainForm.ApplicationDeActivate(Sender: TObject);
|
||||
begin
|
||||
// Prevent completion window from showing up after Alt-Tab. See issue #2640
|
||||
|
Reference in New Issue
Block a user