summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index ae9e16e..53e5cb2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -137,6 +137,7 @@ void eprint(const char *errstr, ...);
137void expose(XEvent *e); 137void expose(XEvent *e);
138void floating(void); /* default floating layout */ 138void floating(void); /* default floating layout */
139void focus(Client *c); 139void focus(Client *c);
140void focusin(XEvent *e);
140void focusnext(const char *arg); 141void focusnext(const char *arg);
141void focusprev(const char *arg); 142void focusprev(const char *arg);
142Client *getclient(Window w); 143Client *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
712void 714void
715focusin(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
722void
713focusnext(const char *arg) { 723focusnext(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))