X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=a80159786b8ca9c9f957e2b04dd28e9cedf3ad54;hb=cc2237bb4f1ff3f32b58e8714f7ba72538df0d91;hp=2974083aacda8279daab9547af2a49cfe011c7dc;hpb=e9f6255b187e9f9283a3d3e3533a6995a77749e3;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 2974083a..a8015978 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -441,7 +441,6 @@ void client_manage(Window window) /* do this after the window is placed, so the premax/prefullscreen numbers won't be all wacko!! - also, this moves the window to the position where it has been placed */ client_apply_startup_state(self); @@ -498,7 +497,7 @@ void client_manage(Window window) is ambiguous (either the current focus target doesn't have a timestamp, or they are the same (we probably inherited it from them) */ - else if (self->transient_for != NULL && + else if (client_has_parent(self) && (!last_time || self->user_time == last_time)) { activate = FALSE; @@ -2374,6 +2373,25 @@ ObClient *client_search_focus_tree_full(ObClient *self) return client_search_focus_tree(self); } +gboolean client_has_parent(ObClient *self) +{ + if (self->transient_for) { + if (self->transient_for != OB_TRAN_GROUP) { + if (client_normal(self->transient_for)) + return TRUE; + } + else if (self->group) { + GSList *it; + + for (it = self->group->members; it; it = g_slist_next(it)) { + if (it->data != self && client_normal(it->data)) + return TRUE; + } + } + } + return FALSE; +} + static ObStackingLayer calc_layer(ObClient *self) { ObStackingLayer l;