gtk: don't move invisible windows to foreground (fixed bug #0013188)

git-svn-id: trunk@18745 -
This commit is contained in:
paul 2009-02-18 10:18:14 +00:00
parent fbfc224459
commit 31c01a588a

View File

@ -8788,19 +8788,26 @@ begin
DebugLn(' LCLObject=nil');
{$ENDIF}
Result := GtkWidgetIsA(PGtkWidget(hWnd),GTK_TYPE_WINDOW);
if Result then begin
GdkWindow:=GetControlWindow(PgtkWidget(hwnd));
if GdkWindow<>nil then begin
AForm:=TCustomForm(GetLCLObject(PgtkWidget(hwnd)));
if (AForm<>nil) and (AForm is TCustomForm) and (AForm.Parent=nil) then
if Result then
begin
GdkWindow := GetControlWindow(PgtkWidget(hwnd));
if GdkWindow <> nil then
begin
if not gdk_window_is_visible(GdkWindow) then
begin
if Screen.CustomFormZIndex(AForm)<Screen.GetCurrentModalFormZIndex then
Result := False;
Exit;
end;
AForm := TCustomForm(GetLCLObject(PgtkWidget(hwnd)));
if (AForm <> nil) and (AForm is TCustomForm) and (AForm.Parent=nil) then
begin
if Screen.CustomFormZIndex(AForm) < Screen.GetCurrentModalFormZIndex then
begin
debugln('TGtkWidgetSet.SetForegroundWindow Form=',DbgSName(AForm),
' can not be raised, because ',
DbgSName(Screen.GetCurrentModalForm),
' is modal and above.');
Result:=false;
Result := False;
exit;
end;
Screen.MoveFormToZFront(AForm);