diff --git a/cmd/wm/client.c b/cmd/wm/client.c index 8236c987..878b01cc 100644 --- a/cmd/wm/client.c +++ b/cmd/wm/client.c @@ -34,6 +34,7 @@ focus_client(Client * c) f->sel = c; XRaiseWindow(dpy, c->win); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); + XSync(dpy, False); invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]); } @@ -51,7 +52,7 @@ set_client_state(Client * c, int state) void show_client(Client * c) { - XMapWindow(dpy, c->win); + XMapRaised(dpy, c->win); set_client_state(c, NormalState); grab_client(c, Mod1Mask, Button1); grab_client(c, Mod1Mask, Button3); diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c index ff57c5b4..9cf96a3b 100644 --- a/cmd/wm/frame.c +++ b/cmd/wm/frame.c @@ -305,7 +305,6 @@ attach_client_to_frame(Frame * f, Client * client) resize_frame(f, &f->rect, 0); reparent_client(client, f->win, client->rect.x, client->rect.y); show_client(client); - focus_client(client); } void diff --git a/cmd/wm/layout_column.c b/cmd/wm/layout_column.c index 3131c558..673e45b3 100644 --- a/cmd/wm/layout_column.c +++ b/cmd/wm/layout_column.c @@ -229,9 +229,6 @@ attach_col(Area * a, Client * c) Column *col = acme->sel; Frame *f = nil; - if(col && col->sel) - f = col->sel->frame; - if(!col) { col = cext_emallocz(sizeof(Column)); col->rect = area_rect; @@ -424,17 +421,14 @@ focus_col(Frame * f, Bool raise) Frame *old = sel_col(a); Cell *cell = f->aux; - if(old == f) - return; - acme->sel = cell->col; cell->col->sel = cell; a->file[A_SEL_FRAME]->content = f->file[F_PREFIX]->content; if(raise) center_pointer(f); - XSync(dpy, False); focus_client(f->sel); - draw_frame(old); + if(old && old != f) + draw_frame(old); draw_frame(f); } diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c index 676844b4..487c0d49 100644 --- a/cmd/wm/wm.c +++ b/cmd/wm/wm.c @@ -824,6 +824,7 @@ cleanup() } } XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); + XSync(dpy, False); } int