X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=59c2274e9104862dbdc19aaf9fc76b5d30fa0935;hb=e7d225b84a2460b7483e56e102cbc35815c945c2;hp=5d897f1c00faf01f78d3956f133ea98815b91b8a;hpb=bf32b376b595eab16a300f63937cad1042361eec;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 5d897f1c..59c2274e 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -132,7 +132,7 @@ void client_manage_all() w = client_startup_stack_order[i-1]; c = g_hash_table_lookup(client_map, &w); - g_message("0x%lx %d", c->window, c->iconic); + g_message("0x%lx %d %d", c->window, c->iconic, c->shaded); if (c) stacking_lower(c); } g_free(client_startup_stack_order); @@ -308,11 +308,6 @@ void client_unmanage(Client *client) dispatch_client(Event_Client_Unmapped, client, 0, 0); g_assert(client != NULL); - /* unfocus the client (dispatchs the focus event) (we're out of the - transient lists already, so being modal doesn't matter) */ - if (client_focused(client)) - client_unfocus(client); - /* give the client its border back */ client_toggle_border(client, TRUE); @@ -898,6 +893,7 @@ static void client_change_allowed_actions(Client *self) else self->shaded = FALSE; } if (!(self->functions & Func_Iconify) && self->iconic) { + g_message("UNSETTING ICONIC"); if (self->frame) client_iconify(self, FALSE, TRUE); else self->iconic = FALSE; } @@ -939,9 +935,11 @@ void client_update_wmhints(Client *self) if (hints->flags & InputHint) self->can_focus = hints->input; - /* only do this when starting! */ - if (ob_state == State_Starting && (hints->flags & StateHint)) - self->iconic = hints->initial_state == IconicState; + /* only do this when first managing the window *AND* when we aren't + starting up! */ + if (ob_state != State_Starting && self->frame == NULL) + if (hints->flags & StateHint) + self->iconic = hints->initial_state == IconicState; if (hints->flags & XUrgencyHint) ur = TRUE; @@ -1947,7 +1945,9 @@ gboolean client_focus(Client *self) } if (self->can_focus) - XSetInputFocus(ob_display, self->window, RevertToPointerRoot, + /* RevertToNone is used so that windows dont get focused inadvertantly + by having the pointer in them, and then FocusIn events go missing */ + XSetInputFocus(ob_display, self->window, RevertToNone, event_lasttime); if (self->focus_notify) {