mirror of
https://github.com/0intro/wmii
synced 2024-12-24 04:16:50 +03:00
some other focus changes, next is to merge Area with Layout and to activate the qid routing
This commit is contained in:
parent
c08cda36ef
commit
ca60ffdf74
@ -29,7 +29,7 @@ void
|
||||
focus_client(Client * c)
|
||||
{
|
||||
Frame *f = 0;
|
||||
Client *old = sel_client();
|
||||
static Client *old = nil;
|
||||
|
||||
if(old && (old != c)) {
|
||||
ungrab_client(old, AnyModifier, AnyButton);
|
||||
@ -46,6 +46,7 @@ focus_client(Client * c)
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
XSync(dpy, False);
|
||||
invoke_wm_event(def[WM_EVENT_CLIENT_UPDATE]);
|
||||
old = c;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -65,8 +65,8 @@ handle_buttonpress(XEvent * e)
|
||||
else if((c = win_to_client(ev->window))) {
|
||||
if(c->frame) { /* client is attached */
|
||||
focus_area(c->frame->area);
|
||||
c->frame->area->layout->focus(c->frame, False);
|
||||
focus_client(c);
|
||||
c->frame->area->layout->focus(c->frame, False);
|
||||
ev->state &= valid_mask;
|
||||
if(ev->state & Mod1Mask) {
|
||||
Align align;
|
||||
|
@ -289,10 +289,6 @@ attach_client_to_frame(Frame * f, Client * client)
|
||||
client->next = nil;
|
||||
c->next = client;
|
||||
}
|
||||
if(f->sel) {
|
||||
ungrab_client(f->sel, AnyModifier, AnyButton);
|
||||
grab_client(f->sel, AnyModifier, AnyButton);
|
||||
}
|
||||
f->sel = client;
|
||||
f->nclients++;
|
||||
client->frame = f;
|
||||
|
@ -431,15 +431,14 @@ focus_col(Frame * f, Bool raise)
|
||||
Acme *acme = a->aux;
|
||||
Frame *old = sel_col(a);
|
||||
Cell *cell = f->aux;
|
||||
Client *c = f->sel ? f->sel : f->clients;
|
||||
|
||||
acme->sel = cell->col;
|
||||
cell->col->sel = cell;
|
||||
a->file[A_SEL_FRAME]->content = f->file[F_PREFIX]->content;
|
||||
if(raise && c)
|
||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
||||
c->rect.width / 2, c->rect.height / 2);
|
||||
focus_client(c);
|
||||
if(raise)
|
||||
XWarpPointer(dpy, None, f->sel->win, 0, 0, 0, 0,
|
||||
f->sel->rect.width / 2, f->sel->rect.height / 2);
|
||||
focus_client(f->sel);
|
||||
if(old && old != f)
|
||||
draw_frame(old);
|
||||
draw_frame(f);
|
||||
|
@ -188,17 +188,15 @@ focus_float(Frame * f, Bool raise)
|
||||
Area *a = f->area;
|
||||
Float *fl = a->aux;
|
||||
Frame *old = fl->sel;
|
||||
Client *c = f->sel ? f->sel : f->clients;
|
||||
|
||||
fl->sel = f;
|
||||
a->file[A_SEL_FRAME]->content = f->file[F_PREFIX]->content;
|
||||
if(raise) {
|
||||
XRaiseWindow(dpy, f->win);
|
||||
if(c)
|
||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
||||
c->rect.width / 2, c->rect.height / 2);
|
||||
XWarpPointer(dpy, None, f->sel->win, 0, 0, 0, 0,
|
||||
f->sel->rect.width / 2, f->sel->rect.height / 2);
|
||||
}
|
||||
focus_client(c);
|
||||
focus_client(f->sel);
|
||||
if(old && old != f)
|
||||
draw_frame(old);
|
||||
draw_frame(f);
|
||||
|
Loading…
Reference in New Issue
Block a user