Index: metacity/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/metacity/ChangeLog,v
retrieving revision 1.553
diff -p -u -5 -r1.553 ChangeLog
--- metacity/ChangeLog	2002/12/02 01:34:26	1.553
+++ metacity/ChangeLog	2002/12/05 09:48:51
@@ -1,5 +1,9 @@
+2002-12-05  Arvind Samptur <arvind.samptur@wipro.com>
+	* src/stack.c (create_constraints): Keep the modal dialogs
+	always on top in a MetaGroup.
+
 2002-12-01  Havoc Pennington  <hp@pobox.com>
 
 	* src/frames.c (get_control): rearrange this function a bit, so
 	that we return CONTROL_TITLE for anything above the bottom of the
 	titlebar, in the fallback case where no other control was found. 
Index: metacity/src/stack.c
===================================================================
RCS file: /export/cvs/gnome-2.0/metacity/src/stack.c,v
retrieving revision 1.58
diff -p -u -5 -r1.58 stack.c
--- metacity/src/stack.c	2002/11/12 21:53:52	1.58
+++ metacity/src/stack.c	2002/12/05 09:48:52
@@ -517,11 +517,12 @@ add_constraint (Constraint **constraints
            w->type == META_WINDOW_MENU ||               \
            w->type == META_WINDOW_UTILITY)
 
 #define WINDOW_TRANSIENT_FOR_WHOLE_GROUP(w)             \
          ((w->xtransient_for == None ||                 \
-           w->transient_parent_is_root_window) &&       \
+           w->transient_parent_is_root_window  ||      \
+           w->type == META_WINDOW_MODAL_DIALOG) &&      \
           WINDOW_HAS_TRANSIENT_TYPE (w))
 
 #define WINDOW_IN_STACK(w) (w->stack_position >= 0)
 
 static void
@@ -571,12 +572,15 @@ create_constraints (Constraint **constra
               if (!(meta_window_is_ancestor_of_transient (w, group_window)) &&
                   !WINDOW_TRANSIENT_FOR_WHOLE_GROUP (group_window))  /* note */;/*note*/
 #else
               /* better way I think, so transient-for-group are constrained
                * only above non-transient-type windows in their group
+               * Also, see to that modal dialogs are always on top in 
+               * MetaGroup
                */
-              if (!WINDOW_HAS_TRANSIENT_TYPE (group_window))
+              if (!WINDOW_HAS_TRANSIENT_TYPE (group_window) || 
+                   w->type == META_WINDOW_MODAL_DIALOG)
 #endif
                 {
                   meta_topic (META_DEBUG_STACK, "Constraining %s above %s as it's transient for its group\n",
                               w->desc, group_window->desc);
                   add_constraint (constraints, w, group_window);
