void expose(XEvent *e);
void floating(void); /* default floating layout */
void focus(Client *c);
+void focusin(XEvent *e);
void focusnext(const char *arg);
void focusprev(const char *arg);
Client *getclient(Window w);
[ConfigureNotify] = configurenotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
- [LeaveNotify] = leavenotify,
[Expose] = expose,
+ [FocusIn] = focusin,
[KeyPress] = keypress,
+ [LeaveNotify] = leavenotify,
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
[PropertyNotify] = propertynotify,
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
+void
+focusin(XEvent *e) { /* there are some broken focus acquiring clients */
+ XFocusChangeEvent *ev = &e->xfocus;
+
+ if(sel && ev->window != sel->win)
+ XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime);
+}
+
void
focusnext(const char *arg) {
Client *c;
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
configure(c); /* propagates border_width, if size doesn't change */
updatesizehints(c);
- XSelectInput(dpy, w,
- StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
+ XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask | PropertyChangeMask | StructureNotifyMask);
grabbuttons(c, False);
updatetitle(c);
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))