X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=256190b97ff7ed74a670daadfe466807384d9274;hb=e84fb1b052584b83947715d8ae4ec5d8afd201e7;hp=23ebf31c8c0ba116abacdea289c73e55f19fcd2b;hpb=00bf97aecd14d58b5dc29519d1bc41dce392d1c8;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 23ebf31c..256190b9 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -262,9 +262,7 @@ void client_manage(Window window) /* choose the events we want to receive on the CLIENT window */ attrib_set.event_mask = CLIENT_EVENTMASK; - attrib_set.do_not_propagate_mask = CLIENT_NOPROPAGATEMASK; - XChangeWindowAttributes(ob_display, window, - CWEventMask|CWDontPropagate, &attrib_set); + XChangeWindowAttributes(ob_display, window, CWEventMask, &attrib_set); /* create the ObClient struct, and populate it from the hints on the @@ -277,7 +275,7 @@ void client_manage(Window window) self->wmstate = WithdrawnState; /* make sure it gets updated first time */ self->layer = -1; self->desktop = screen_num_desktops; /* always an invalid value */ - self->user_time = CurrentTime; + self->user_time = focus_client ? focus_client->user_time : CurrentTime; client_get_all(self); /* per-app settings override stuff, and return the settings for other @@ -503,22 +501,8 @@ void client_unmanage(ObClient *self) /* update the focus lists */ focus_order_remove(self); if (client_focused(self)) { - /* we have to fall back here because we might not get a focus out. - 1. we need to xselectinput off the window before we unmap it because - otherwise we end up getting unmapnotifies we don't want and they - can mess up mapping it again quickly - 2. this means that if we unmanage from a synthetic unmapnotify, we - are the ones unmapped it, and causing the focusout. so we won't - get the focusout event. - 3. we can't handle focusin events on the root window because they - come from all screens, so the focus change gets lost - - if this ever gets removed in the future MAKE SURE to replace it - with: - /- don't leave an invalid focus_client -/ - focus_client = NULL; - */ - focus_fallback(FALSE); + /* don't leave an invalid focus_client */ + focus_client = NULL; } client_list = g_list_remove(client_list, self); @@ -929,7 +913,10 @@ static void client_get_all(ObClient *self) /* The transient hint is used to pick a type, but the type can also affect transiency (dialogs are always made transients of their group if they have one). This is Havoc's idea, but it is needed to make some apps - work right (eg tsclient). */ + work right (eg tsclient). + I also have made non-application type windows be transients based on + their type, like dialogs. + */ client_update_transient_for(self); client_get_type(self);/* this can change the mwmhints for special cases */ client_get_state(self); @@ -1215,18 +1202,6 @@ void client_update_transient_for(ObClient *self) c->transient_for != OB_TRAN_GROUP)) c->transients = g_slist_append(c->transients, self); } - - /* remove all transients which are in the group, that causes - circlular pointer hell of doom */ - for (it = self->group->members; it; it = g_slist_next(it)) { - GSList *sit, *next; - for (sit = self->transients; sit; sit = next) { - next = g_slist_next(sit); - if (sit->data == it->data) - self->transients = - g_slist_delete_link(self->transients, sit); - } - } } else if (self->transient_for != NULL) { /* transient of window */ /* add to new parent */ self->transient_for->transients = @@ -1669,7 +1644,8 @@ void client_update_wmhints(ObClient *self) { ObClient *c = it->data; - if (c != self && !c->transient_for) + if (c != self && (!c->transient_for || + c->transient_for != OB_TRAN_GROUP)) c->transients = g_slist_remove(c->transients, self); } @@ -1678,12 +1654,23 @@ void client_update_wmhints(ObClient *self) group_remove(self->group, self); self->group = NULL; } + + /* because the self->transient flag wont change from this call, + we don't need to update the window's type and such, only its + transient_for, and the transients lists of other windows in + the group may be affected + + do this before adding transients from the group so we know if + we are actually transient for the group or not. + */ + client_update_transient_for(self); + if (hints->window_group != None) { self->group = group_add(hints->window_group, self); /* i can only have transients from the group if i am not - transient myself */ - if (!self->transient_for) { + transient for the group myself */ + if (self->transient_for != OB_TRAN_GROUP) { /* add other transients of the group that are already set up */ for (it = self->group->members; it; @@ -1696,12 +1683,6 @@ void client_update_wmhints(ObClient *self) } } } - - /* because the self->transient flag wont change from this call, - we don't need to update the window's type and such, only its - transient_for, and the transients lists of other windows in - the group may be affected */ - client_update_transient_for(self); } /* the WM_HINTS can contain an icon */