diff --git a/ChangeLog b/ChangeLog index 851fdaded..8d838d8bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2002-09-27 Havoc Pennington + + * src/window.c (update_transient_for): keep a flag + transient_parent_is_root_window for whether the + root-window-as-parent convention was used. + +2002-09-25 Arvind Samptur + + * src/stack.c (sort_window_list): Keep dialogs without + transient parent above entire app. Fixes #88926 + 2002-09-26 Havoc Pennington * src/menu.c (meta_window_menu_new): use MetaAccelLabel to display diff --git a/src/stack.c b/src/stack.c index ffa8e2791..e9b4b466c 100644 --- a/src/stack.c +++ b/src/stack.c @@ -390,8 +390,37 @@ sort_window_list (GList *list) while (tmp != NULL) { MetaWindow *w = tmp->data; + + if ((w->xtransient_for == None || + w->transient_parent_is_root_window) && + (w->type == META_WINDOW_DIALOG || + w->type == META_WINDOW_MODAL_DIALOG)) + { + GSList *group_windows; + GSList *tmp; + MetaGroup *group; - if (w->xtransient_for != None) + group = meta_window_get_group (w); + + if (group != NULL) + group_windows = meta_group_list_windows (group); + else + group_windows = NULL; + + tmp = group_windows; + + while (tmp != NULL) + { + MetaWindow *group_window = tmp->data; + + if (!(meta_window_is_ancestor_of_transient (w, group_window))) + list = ensure_before (list, w, group_window); + + tmp = tmp->next; + } + } + else if (w->xtransient_for != None && + !w->transient_parent_is_root_window) { MetaWindow *parent; diff --git a/src/window.c b/src/window.c index d39246f8c..79ce4e3ec 100644 --- a/src/window.c +++ b/src/window.c @@ -401,6 +401,7 @@ meta_window_new (MetaDisplay *display, Window xwindow, window->xtransient_for = None; window->xgroup_leader = None; window->xclient_leader = None; + window->transient_parent_is_root_window = FALSE; window->type = META_WINDOW_NORMAL; window->type_atom = None; @@ -1142,7 +1143,8 @@ meta_window_calc_showing (MetaWindow *window) break; } - if (w->xtransient_for == None) + if (w->xtransient_for == None || + w->transient_parent_is_root_window) break; w = meta_display_lookup_x_window (w->display, w->xtransient_for); @@ -1822,7 +1824,8 @@ unminimize_window_and_all_transient_parents (MetaWindow *window) { meta_window_unminimize (w); - if (w->xtransient_for == None) + if (w->xtransient_for == None || + w->transient_parent_is_root_window) break; w = meta_display_lookup_x_window (w->display, w->xtransient_for); @@ -4618,7 +4621,8 @@ update_sm_hints (MetaWindow *window) if (leader != None) break; - if (w->xtransient_for == None) + if (w->xtransient_for == None || + w->transient_parent_is_root_window) break; w = meta_display_lookup_x_window (w->display, w->xtransient_for); @@ -4705,12 +4709,15 @@ update_transient_for (MetaWindow *window) &w); window->xtransient_for = w; + window->transient_parent_is_root_window = + window->xtransient_for == window->screen->xroot; + if (window->xtransient_for != None) - meta_verbose ("Window %s transient for 0x%lx\n", window->desc, - window->xtransient_for); + meta_verbose ("Window %s transient for 0x%lx (root = %d)\n", window->desc, + window->xtransient_for, window->transient_parent_is_root_window); else meta_verbose ("Window %s is not transient\n", window->desc); - + /* may now be a dialog */ recalc_window_type (window); @@ -6478,7 +6485,8 @@ meta_window_is_ancestor_of_transient (MetaWindow *window, w = transient; while (w != NULL) { - if (w->xtransient_for == None) + if (w->xtransient_for == None || + w->transient_parent_is_root_window) return FALSE; if (w->xtransient_for == window->xwindow) diff --git a/src/window.h b/src/window.h index dc48bfe4c..c46463125 100644 --- a/src/window.h +++ b/src/window.h @@ -204,6 +204,9 @@ struct _MetaWindow guint has_struts : 1; /* Struts are from the _WIN_HINTS do not cover deal */ guint do_not_cover : 1; + + /* Transient parent is a root window */ + guint transient_parent_is_root_window : 1; /* Number of UnmapNotify that are caused by us, if * we get UnmapNotify with none pending then the client