for(a.i = 0; a.i < ntags; a.i++) {
x += textw(tags[a.i]);
if(ev->x < x) {
- view(&a);
- break;
+ if(ev->button == Button3)
+ viewextend(&a);
+ else
+ view(&a);
+ return;
}
}
+ if(ev->button == Button1)
+ viewprev(&a);
+ else if(ev->button == Button3)
+ viewnext(&a);
break;
case Button4:
- viewnext(&a);
+ viewprev(&a);
break;
case Button5:
- viewprev(&a);
+ viewnext(&a);
break;
}
}
else if((c = getclient(ev->window))) {
+ higher(c);
focus(c);
switch(ev->button) {
default:
break;
case Button1:
- if(!c->ismax && (arrange == dofloat || c->isfloat)) {
- higher(c);
+ if(!c->ismax && (arrange == dofloat || c->isfloat))
movemouse(c);
- }
break;
case Button2:
- lower(c);
+ zoom(NULL);
break;
case Button3:
- if(!c->ismax && (arrange == dofloat || c->isfloat)) {
- higher(c);
+ if(!c->ismax && (arrange == dofloat || c->isfloat))
resizemouse(c);
- }
break;
}
}
}
-static void
-clientmessage(XEvent *e)
-{
- Client *c;
- XClientMessageEvent *ev = &e->xclient;
-
- if(ev->message_type == netatom[NetActiveWindow]) {
- if((c = getclient(ev->window)) && c->tags[tsel])
- focus(c);
- }
-}
-
static void
configurerequest(XEvent *e)
{
Client *c;
XCrossingEvent *ev = &e->xcrossing;
- if(ev->detail == NotifyInferior)
+ if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
if((c = getclient(ev->window)) || (c = getctitle(ev->window)))
focus(c);
- else if(ev->window == root)
+ else if(ev->window == root) {
issel = True;
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ drawall();
+ }
}
static void
{
XCrossingEvent *ev = &e->xcrossing;
- if((ev->window == root) && !ev->same_screen)
- issel = True;
+ if((ev->window == root) && !ev->same_screen) {
+ issel = False;
+ drawall();
+ }
}
static void
void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
- [ClientMessage] = clientmessage,
[ConfigureRequest] = configurerequest,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,