+focus_magic(struct ws_win *win)
+{
+ if (win->child_trans) {
+ /* win = parent & has a transient so focus on that */
+ if (win->java) {
+ focus_win(win->child_trans);
+ if (win->child_trans->take_focus)
+ client_msg(win, takefocus);
+ } else {
+ focus_win(win->child_trans);
+ if (win->child_trans->take_focus)
+ client_msg(win->child_trans, takefocus);
+ }
+ } else {
+ /* regular focus */
+ focus_win(win);
+ if (win->take_focus)
+ client_msg(win, takefocus);
+ }
+}
+
+Bool
+destroy_notify_cb(Display *d, XEvent *e, char *arg)
+{
+ struct ws_win *win = (struct ws_win *)arg;
+ if (win && win->id == e->xany.window && e->xany.type == DestroyNotify)
+ return (True);
+ return (False);
+}
+
+void