keep a flag transient_parent_is_root_window for whether the

2002-09-27  Havoc Pennington  <hp@redhat.com>

	* 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 <arvind.samptur@wipro.com>

 	* src/stack.c (sort_window_list): Keep dialogs without
 	transient parent above entire app. Fixes #88926
This commit is contained in:
Havoc Pennington 2002-09-27 19:42:59 +00:00 committed by Havoc Pennington
parent 47f67eb270
commit e7e41b045d
4 changed files with 59 additions and 8 deletions

View File

@ -1,3 +1,14 @@
2002-09-27 Havoc Pennington <hp@redhat.com>
* 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 <arvind.samptur@wipro.com>
* src/stack.c (sort_window_list): Keep dialogs without
transient parent above entire app. Fixes #88926
2002-09-26 Havoc Pennington <hp@pobox.com> 2002-09-26 Havoc Pennington <hp@pobox.com>
* src/menu.c (meta_window_menu_new): use MetaAccelLabel to display * src/menu.c (meta_window_menu_new): use MetaAccelLabel to display

View File

@ -390,8 +390,37 @@ sort_window_list (GList *list)
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *w = tmp->data; 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; MetaWindow *parent;

View File

@ -401,6 +401,7 @@ meta_window_new (MetaDisplay *display, Window xwindow,
window->xtransient_for = None; window->xtransient_for = None;
window->xgroup_leader = None; window->xgroup_leader = None;
window->xclient_leader = None; window->xclient_leader = None;
window->transient_parent_is_root_window = FALSE;
window->type = META_WINDOW_NORMAL; window->type = META_WINDOW_NORMAL;
window->type_atom = None; window->type_atom = None;
@ -1142,7 +1143,8 @@ meta_window_calc_showing (MetaWindow *window)
break; break;
} }
if (w->xtransient_for == None) if (w->xtransient_for == None ||
w->transient_parent_is_root_window)
break; break;
w = meta_display_lookup_x_window (w->display, w->xtransient_for); 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); meta_window_unminimize (w);
if (w->xtransient_for == None) if (w->xtransient_for == None ||
w->transient_parent_is_root_window)
break; break;
w = meta_display_lookup_x_window (w->display, w->xtransient_for); w = meta_display_lookup_x_window (w->display, w->xtransient_for);
@ -4618,7 +4621,8 @@ update_sm_hints (MetaWindow *window)
if (leader != None) if (leader != None)
break; break;
if (w->xtransient_for == None) if (w->xtransient_for == None ||
w->transient_parent_is_root_window)
break; break;
w = meta_display_lookup_x_window (w->display, w->xtransient_for); w = meta_display_lookup_x_window (w->display, w->xtransient_for);
@ -4705,12 +4709,15 @@ update_transient_for (MetaWindow *window)
&w); &w);
window->xtransient_for = w; window->xtransient_for = w;
window->transient_parent_is_root_window =
window->xtransient_for == window->screen->xroot;
if (window->xtransient_for != None) if (window->xtransient_for != None)
meta_verbose ("Window %s transient for 0x%lx\n", window->desc, meta_verbose ("Window %s transient for 0x%lx (root = %d)\n", window->desc,
window->xtransient_for); window->xtransient_for, window->transient_parent_is_root_window);
else else
meta_verbose ("Window %s is not transient\n", window->desc); meta_verbose ("Window %s is not transient\n", window->desc);
/* may now be a dialog */ /* may now be a dialog */
recalc_window_type (window); recalc_window_type (window);
@ -6478,7 +6485,8 @@ meta_window_is_ancestor_of_transient (MetaWindow *window,
w = transient; w = transient;
while (w != NULL) while (w != NULL)
{ {
if (w->xtransient_for == None) if (w->xtransient_for == None ||
w->transient_parent_is_root_window)
return FALSE; return FALSE;
if (w->xtransient_for == window->xwindow) if (w->xtransient_for == window->xwindow)

View File

@ -204,6 +204,9 @@ struct _MetaWindow
guint has_struts : 1; guint has_struts : 1;
/* Struts are from the _WIN_HINTS do not cover deal */ /* Struts are from the _WIN_HINTS do not cover deal */
guint do_not_cover : 1; 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 /* Number of UnmapNotify that are caused by us, if
* we get UnmapNotify with none pending then the client * we get UnmapNotify with none pending then the client