diff options
| -rw-r--r-- | dwm.c | 15 |
1 files changed, 12 insertions, 3 deletions
| @@ -137,6 +137,7 @@ void eprint(const char *errstr, ...); | |||
| 137 | void expose(XEvent *e); | 137 | void expose(XEvent *e); |
| 138 | void floating(void); /* default floating layout */ | 138 | void floating(void); /* default floating layout */ |
| 139 | void focus(Client *c); | 139 | void focus(Client *c); |
| 140 | void focusin(XEvent *e); | ||
| 140 | void focusnext(const char *arg); | 141 | void focusnext(const char *arg); |
| 141 | void focusprev(const char *arg); | 142 | void focusprev(const char *arg); |
| 142 | Client *getclient(Window w); | 143 | Client *getclient(Window w); |
| @@ -206,9 +207,10 @@ void (*handler[LASTEvent]) (XEvent *) = { | |||
| 206 | [ConfigureNotify] = configurenotify, | 207 | [ConfigureNotify] = configurenotify, |
| 207 | [DestroyNotify] = destroynotify, | 208 | [DestroyNotify] = destroynotify, |
| 208 | [EnterNotify] = enternotify, | 209 | [EnterNotify] = enternotify, |
| 209 | [LeaveNotify] = leavenotify, | ||
| 210 | [Expose] = expose, | 210 | [Expose] = expose, |
| 211 | [FocusIn] = focusin, | ||
| 211 | [KeyPress] = keypress, | 212 | [KeyPress] = keypress, |
| 213 | [LeaveNotify] = leavenotify, | ||
| 212 | [MappingNotify] = mappingnotify, | 214 | [MappingNotify] = mappingnotify, |
| 213 | [MapRequest] = maprequest, | 215 | [MapRequest] = maprequest, |
| 214 | [PropertyNotify] = propertynotify, | 216 | [PropertyNotify] = propertynotify, |
| @@ -710,6 +712,14 @@ focus(Client *c) { | |||
| 710 | } | 712 | } |
| 711 | 713 | ||
| 712 | void | 714 | void |
| 715 | focusin(XEvent *e) { /* there are some broken focus acquiring clients */ | ||
| 716 | XFocusChangeEvent *ev = &e->xfocus; | ||
| 717 | |||
| 718 | if(sel && ev->window != sel->win) | ||
| 719 | XSetInputFocus(dpy, sel->win, RevertToPointerRoot, CurrentTime); | ||
| 720 | } | ||
| 721 | |||
| 722 | void | ||
| 713 | focusnext(const char *arg) { | 723 | focusnext(const char *arg) { |
| 714 | Client *c; | 724 | Client *c; |
| 715 | 725 | ||
| @@ -1026,8 +1036,7 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 1026 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); | 1036 | XSetWindowBorder(dpy, w, dc.norm[ColBorder]); |
| 1027 | configure(c); /* propagates border_width, if size doesn't change */ | 1037 | configure(c); /* propagates border_width, if size doesn't change */ |
| 1028 | updatesizehints(c); | 1038 | updatesizehints(c); |
| 1029 | XSelectInput(dpy, w, | 1039 | XSelectInput(dpy, w, EnterWindowMask | FocusChangeMask | PropertyChangeMask | StructureNotifyMask); |
| 1030 | StructureNotifyMask | PropertyChangeMask | EnterWindowMask); | ||
| 1031 | grabbuttons(c, False); | 1040 | grabbuttons(c, False); |
| 1032 | updatetitle(c); | 1041 | updatetitle(c); |
| 1033 | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) | 1042 | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) |
