fixes for transients

1) don't count non-normal windows as parents when placing/stacking transients
2) in stacking.c, when a window is transient for the group but has no parents, then don't loop forever looking for its parents
This commit is contained in:
Dana Jansens 2007-04-21 21:32:21 +00:00
parent 3f2d342de8
commit 0e9bd66b75
3 changed files with 26 additions and 22 deletions

View file

@ -3341,7 +3341,7 @@ GSList *client_search_all_top_parents(ObClient *self)
for (it = self->group->members; it; it = g_slist_next(it)) { for (it = self->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data; ObClient *c = it->data;
if (!c->transient_for) if (!c->transient_for && client_normal(c))
ret = g_slist_prepend(ret, c); ret = g_slist_prepend(ret, c);
} }

View file

@ -429,7 +429,7 @@ static gboolean place_transient(ObClient *client, gint *x, gint *y)
gint l, r, t, b; gint l, r, t, b;
for (it = client->group->members; it; it = g_slist_next(it)) { for (it = client->group->members; it; it = g_slist_next(it)) {
ObClient *m = it->data; ObClient *m = it->data;
if (!(m == client || m->transient_for)) { if (!(m == client || m->transient_for) && client_normal(m)) {
if (first) { if (first) {
l = RECT_LEFT(m->frame->area); l = RECT_LEFT(m->frame->area);
t = RECT_TOP(m->frame->area); t = RECT_TOP(m->frame->area);

View file

@ -176,6 +176,8 @@ static void restack_windows(ObClient *selected, gboolean raise)
this window, or it won't move */ this window, or it won't move */
top = client_search_all_top_parents(selected); top = client_search_all_top_parents(selected);
/* that is, if it has any parents */
if (!(top->data == selected && top->next == NULL)) {
/* go thru stacking list backwards so we can use g_slist_prepend */ /* go thru stacking list backwards so we can use g_slist_prepend */
for (it = g_list_last(stacking_list); it && top; for (it = g_list_last(stacking_list); it && top;
it = g_list_previous(it)) it = g_list_previous(it))
@ -190,6 +192,7 @@ static void restack_windows(ObClient *selected, gboolean raise)
restack_windows(top_it->data, raise); restack_windows(top_it->data, raise);
return; return;
} }
}
/* remove first so we can't run into ourself */ /* remove first so we can't run into ourself */
it = g_list_find(stacking_list, selected); it = g_list_find(stacking_list, selected);
@ -391,7 +394,8 @@ void stacking_add_nonintrusive(ObWindow *win)
sit = g_slist_next(sit)) sit = g_slist_next(sit))
{ {
ObClient *c = sit->data; ObClient *c = sit->data;
/* checking transient_for prevents infinate loops! */ /* checking transient_for prevents infinate loops!
*/
if (sit->data == it->data && !c->transient_for) if (sit->data == it->data && !c->transient_for)
parent = it->data; parent = it->data;
} }