Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4380db4
)
fixed focus steeling bug done by clients like opera
author
Anselm R. Garbe <
[email protected]
>
Sat, 17 Nov 2007 18:59:13 +0000
(19:59 +0100)
committer
Anselm R. Garbe <
[email protected]
>
Sat, 17 Nov 2007 18:59:13 +0000
(19:59 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
ae9e16e
..
53e5cb2
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-137,6
+137,7
@@
void eprint(const char *errstr, ...);
void expose(XEvent *e);
void floating(void); /* default floating layout */
void focus(Client *c);
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);
void focusnext(const char *arg);
void focusprev(const char *arg);
Client *getclient(Window w);
@@
-206,9
+207,10
@@
void (*handler[LASTEvent]) (XEvent *) = {
[ConfigureNotify] = configurenotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
[ConfigureNotify] = configurenotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
- [LeaveNotify] = leavenotify,
[Expose] = expose,
[Expose] = expose,
+ [FocusIn] = focusin,
[KeyPress] = keypress,
[KeyPress] = keypress,
+ [LeaveNotify] = leavenotify,
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
[PropertyNotify] = propertynotify,
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
[PropertyNotify] = propertynotify,
@@
-709,6
+711,14
@@
focus(Client *c) {
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
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;
void
focusnext(const char *arg) {
Client *c;
@@
-1026,8
+1036,7
@@
manage(Window w, XWindowAttributes *wa) {
XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
configure(c); /* propagates border_width, if size doesn't change */
updatesizehints(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))
grabbuttons(c, False);
updatetitle(c);
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))