summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-30 11:44:24 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-30 11:44:24 +0200
commit2ffdd747a6f01ba994e8484523695bf7346bca63 (patch)
tree1912bd53ac8c6359d2f5c732b0809a2b5a0e2c98 /src/corelib/gdi
parente8acfe93147d885637b31815acbfd4a19136ab17 (diff)
downloadfpGUI-2ffdd747a6f01ba994e8484523695bf7346bca63.tar.xz
Fix bug returning to previous active window after opening modal form
* If you had a main form and a non-modal form, and the non-modal opened a modal window, then the following happened in error: - modal form could open behind non-modal for, treating main form as parent. - when modal form closed, it set main form active, instead of non-modal form. This is now fixed.
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index ccf460e2..26abf534 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -1392,8 +1392,12 @@ begin
end
else if WindowType = wtModalForm then
begin
- // set parent window to special hidden window. It helps to hide window taskbar button.
- FParentWinHandle := wapplication.GetHiddenWindow;
+ if FocusRootWidget <> nil then
+ FParentWinHandle := FocusRootWidget.WinHandle
+ else
+ // set parent window to special hidden window. It helps to hide window taskbar button.
+ FParentWinHandle := wapplication.GetHiddenWindow;
+
// for modal windows, this is necessary
FWinStyle := WS_OVERLAPPEDWINDOW or WS_POPUPWINDOW;
FWinStyle := FWinStyle and not (WS_MINIMIZEBOX);