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>
* src/menu.c (meta_window_menu_new): use MetaAccelLabel to display

View File

@ -391,7 +391,36 @@ sort_window_list (GList *list)
{
MetaWindow *w = tmp->data;
if (w->xtransient_for != None)
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;
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;

View File

@ -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,9 +4709,12 @@ 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);
@ -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)

View File

@ -205,6 +205,9 @@ struct _MetaWindow
/* 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
* is withdrawing the window.