|
|
@ -556,6 +556,11 @@ run(void) |
|
|
|
if (XFilterEvent(&ev, None)) |
|
|
|
if (XFilterEvent(&ev, None)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
switch(ev.type) { |
|
|
|
switch(ev.type) { |
|
|
|
|
|
|
|
case DestroyNotify: |
|
|
|
|
|
|
|
if (ev.xdestroywindow.window != win) |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
cleanup(); |
|
|
|
|
|
|
|
exit(1); |
|
|
|
case Expose: |
|
|
|
case Expose: |
|
|
|
if (ev.xexpose.count == 0) |
|
|
|
if (ev.xexpose.count == 0) |
|
|
|
drw_map(drw, win, 0, 0, mw, mh); |
|
|
|
drw_map(drw, win, 0, 0, mw, mh); |
|
|
@ -667,7 +672,7 @@ setup(void) |
|
|
|
XMapRaised(dpy, win); |
|
|
|
XMapRaised(dpy, win); |
|
|
|
XSetInputFocus(dpy, win, RevertToParent, CurrentTime); |
|
|
|
XSetInputFocus(dpy, win, RevertToParent, CurrentTime); |
|
|
|
if (embed) { |
|
|
|
if (embed) { |
|
|
|
XSelectInput(dpy, parentwin, FocusChangeMask); |
|
|
|
XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask); |
|
|
|
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) { |
|
|
|
if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) { |
|
|
|
for (i = 0; i < du && dws[i] != win; ++i) |
|
|
|
for (i = 0; i < du && dws[i] != win; ++i) |
|
|
|
XSelectInput(dpy, dws[i], FocusChangeMask); |
|
|
|
XSelectInput(dpy, dws[i], FocusChangeMask); |
|
|
|