mirror of https://github.com/0intro/wmii
fixed several issues in column layout reported by tube
This commit is contained in:
parent
d8daa2fe96
commit
ace9b63747
|
@ -36,6 +36,24 @@ set_client_state(Client * c, int state)
|
|||
(unsigned char *) data, 2);
|
||||
}
|
||||
|
||||
void
|
||||
focus_client(Client *new, Client *old)
|
||||
{
|
||||
if(old && (old != new)) {
|
||||
ungrab_client(old, AnyModifier, AnyButton);
|
||||
grab_client(old, AnyModifier, AnyButton);
|
||||
draw_frame(old->frame);
|
||||
}
|
||||
ungrab_client(new, AnyModifier, AnyButton);
|
||||
grab_client(new, Mod1Mask, Button1);
|
||||
grab_client(new, Mod1Mask, Button3);
|
||||
XRaiseWindow(dpy, new->win);
|
||||
XSetInputFocus(dpy, new->win, RevertToPointerRoot, CurrentTime);
|
||||
draw_frame(new->frame);
|
||||
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
|
||||
XSync(dpy, False);
|
||||
}
|
||||
|
||||
void
|
||||
map_client(Client * c)
|
||||
{
|
||||
|
|
|
@ -180,6 +180,7 @@ detach_frame(Layout *l, Frame * old)
|
|||
acme->frames = old->next;
|
||||
if(old->next)
|
||||
old->next->prev = old->prev;
|
||||
old->prev = old->next = nil;
|
||||
old->aux = nil;
|
||||
detach_frame_from_layout(old);
|
||||
acme->nframes--;
|
||||
|
@ -424,19 +425,7 @@ focus_col(Layout *l, Client *c, Bool raise)
|
|||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
||||
c->rect.width / 2, c->rect.height / 2);
|
||||
|
||||
if(old && (old != c)) {
|
||||
ungrab_client(old, AnyModifier, AnyButton);
|
||||
grab_client(old, AnyModifier, AnyButton);
|
||||
draw_frame(old->frame);
|
||||
}
|
||||
ungrab_client(c, AnyModifier, AnyButton);
|
||||
grab_client(c, Mod1Mask, Button1);
|
||||
grab_client(c, Mod1Mask, Button3);
|
||||
XRaiseWindow(dpy, c->win);
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
draw_frame(c->frame);
|
||||
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
|
||||
XSync(dpy, False);
|
||||
focus_client(c, old);
|
||||
}
|
||||
|
||||
static Frame *
|
||||
|
@ -504,7 +493,7 @@ select_frame(void *obj, char *arg)
|
|||
for(cell = col->cells; cell && i != idx; cell = cell->next)
|
||||
i++;
|
||||
}
|
||||
if(cell && cell != col)
|
||||
if(cell && cell != col->sel)
|
||||
focus_col(l, cell->frame->sel, True);
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ detach_frame(Layout *l, Frame * old)
|
|||
if(fl->sel == old)
|
||||
fl->sel = fl->frames;
|
||||
|
||||
old->prev = old->next = nil;
|
||||
detach_frame_from_layout(old);
|
||||
fl->nframes--;
|
||||
}
|
||||
|
@ -193,18 +194,7 @@ focus_float(Layout *l, Client *c, Bool raise)
|
|||
c->rect.width / 2, c->rect.height / 2);
|
||||
}
|
||||
|
||||
if(old && (old != c)) {
|
||||
grab_client(old, AnyModifier, AnyButton);
|
||||
draw_frame(old->frame);
|
||||
}
|
||||
ungrab_client(c, AnyModifier, AnyButton);
|
||||
grab_client(c, Mod1Mask, Button1);
|
||||
grab_client(c, Mod1Mask, Button3);
|
||||
XRaiseWindow(dpy, c->win);
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
draw_frame(c->frame);
|
||||
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
|
||||
XSync(dpy, False);
|
||||
focus_client(c, old);
|
||||
}
|
||||
|
||||
static Frame *
|
||||
|
|
|
@ -229,6 +229,7 @@ Client *sel_client();
|
|||
Client *clientat(Client * clients, size_t idx);
|
||||
void detach_detached(Client * c);
|
||||
void attach_detached(Client * c);
|
||||
void focus_client(Client *new, Client *old);
|
||||
|
||||
/* frame.c */
|
||||
Frame *win_to_frame(Window w);
|
||||
|
|
Loading…
Reference in New Issue