135 void enternotify(XEvent *e); |
135 void enternotify(XEvent *e); |
136 void eprint(const char *errstr, ...); |
136 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); |
143 unsigned long getcolor(const char *colstr); |
144 unsigned long getcolor(const char *colstr); |
144 long getstate(Window w); |
145 long getstate(Window w); |
204 [ButtonPress] = buttonpress, |
205 [ButtonPress] = buttonpress, |
205 [ConfigureRequest] = configurerequest, |
206 [ConfigureRequest] = configurerequest, |
206 [ConfigureNotify] = configurenotify, |
207 [ConfigureNotify] = configurenotify, |
207 [DestroyNotify] = destroynotify, |
208 [DestroyNotify] = destroynotify, |
208 [EnterNotify] = enternotify, |
209 [EnterNotify] = enternotify, |
|
210 [Expose] = expose, |
|
211 [FocusIn] = focusin, |
|
212 [KeyPress] = keypress, |
209 [LeaveNotify] = leavenotify, |
213 [LeaveNotify] = leavenotify, |
210 [Expose] = expose, |
|
211 [KeyPress] = keypress, |
|
212 [MappingNotify] = mappingnotify, |
214 [MappingNotify] = mappingnotify, |
213 [MapRequest] = maprequest, |
215 [MapRequest] = maprequest, |
214 [PropertyNotify] = propertynotify, |
216 [PropertyNotify] = propertynotify, |
215 [UnmapNotify] = unmapnotify |
217 [UnmapNotify] = unmapnotify |
216 }; |
218 }; |
708 else |
710 else |
709 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
711 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
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 |
716 if(!sel) |
726 if(!sel) |
717 return; |
727 return; |
1024 wc.border_width = c->border; |
1034 wc.border_width = c->border; |
1025 XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
1035 XConfigureWindow(dpy, w, CWBorderWidth, &wc); |
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)) |
1034 for(t = clients; t && t->win != trans; t = t->next); |
1043 for(t = clients; t && t->win != trans; t = t->next); |
1035 if(t) |
1044 if(t) |