From c1f841cf9a45ad01e80195806fd4c0739d5180a5 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 23 May 2012 12:24:13 +0200 Subject: TfpgGDIWindow.ActivateWindow now uses SetWindowPos instead of SetForegroundWindow. The code and intent seems to be correct, but even though I set the flag SWP_NOZORDER (so the behaviour is consistent with Linux X11), Windows seems to ignore that flag and still bring the active window to the front. --- src/corelib/gdi/fpg_gdi.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib/gdi') diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas index 2bbdd389..d5e2bf19 100644 --- a/src/corelib/gdi/fpg_gdi.pas +++ b/src/corelib/gdi/fpg_gdi.pas @@ -2033,7 +2033,10 @@ end; procedure TfpgGDIWindow.ActivateWindow; begin - SetForegroundWindow(FWinHandle); + Windows.SetWindowPos( + WinHandle, HWND_NOTOPMOST, + FLeft, FTop, FWidth, FHeight, + SWP_NOZORDER or SWP_NOSIZE); end; procedure TfpgGDIWindow.CaptureMouse; -- cgit v1.2.3-70-g09d2