From 3de794c373be08b3f8ceeb9d578f8ed2d93e1384 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 17 Aug 2002 23:40:54 +0000 Subject: [PATCH] set transient forms with Screen object order git-svn-id: trunk@2087 - --- lcl/interfaces/gtk/gtkobject.inc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index 3f83c419cf..75b7a9d3d8 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -378,6 +378,11 @@ begin else ATransientWindow^.SortIndex:=-1; ATransientWindow^.IsModal:=ATransientWindow^.SortIndex>=0; + if not ATransientWindow^.IsModal then begin + if LCLObject is TCustomForm then + ATransientWindow^.SortIndex:= + Screen.CustomFormIndex(TCustomForm(LCLObject)); + end; if AllWindows=nil then AllWindows:=TList.Create; AllWindows.Add(ATransientWindow); end; @@ -429,8 +434,16 @@ begin // sort non modal windows for z order // ToDo: How do we get the z order? - // For now, just use the creation order - + // For now, just use the inverse order in the Screen object + // that means: the lower in the Screen object, the later in the transient list + for i:=0 to FirstModal-2 do begin + for j:=i+1 to FirstModal-1 do begin + ATransientWindow1:=PTransientWindow(AllWindows[i]); + ATransientWindow2:=PTransientWindow(AllWindows[j]); + if ATransientWindow1^.SortIndexnil then begin + //writeln('Set TRANSIENT Parent=',ParentTransientWindow^.Component.Name,':',ParentTransientWindow^.Component.ClassName,' ',ParentTransientWindow^.SortIndex, + //' Child=',ATransientWindow^.Component.Name,':',ATransientWindow^.Component.ClassName,' ',ATransientWindow^.SortIndex); gtk_window_set_transient_for(ATransientWindow^.GtkWindow, ParentTransientWindow^.GtkWindow); end; @@ -7046,6 +7061,9 @@ end; { ============================================================================= $Log$ + Revision 1.338 2003/03/18 13:45:39 mattias + set transient forms with Screen object order + Revision 1.337 2003/03/18 13:04:25 mattias improved focus debugging output